1 2 Previous Next 18 Replies Latest reply: Apr 24, 2012 4:03 PM by 636948 Go to original post RSS
      • 15. Re: Barcodes in HTMLDB - Question
        617013
        I found the problem. For code 39 it has to be encapsulated with an asterix in the front and the back. Second it needs an extra quiet space around it.
        Works great.

        Fantastic.
        • 16. Re: Barcodes in HTMLDB - solved
          636948
          Hi Pavel,

          I was looking at your application to print a barcode from APEX. Can you please post the pl/sql code for the application process. I need to do same thing with one APEX. I really appreciate it if you can clarify the steps more. Thank you so much.

          Regards,
          SH
          • 17. Re: Barcodes in HTMLDB - Question
            636948
            Hello,

            Can anyone tell me what is wrong with this procedure. I am trying to use it to print barcode, it compiles fine but when I run it I get the error saying numeric or value error.

            Here is the pl/sql application process

            CREATE OR REPLACE PACKAGE BODY PROD.APX_BARCODE
            IS
            PROCEDURE barcode_pr (
            code39text IN VARCHAR2 DEFAULT 'anyname',
            code39label IN VARCHAR2 DEFAULT 'Yes',
            code_height IN NUMBER DEFAULT 20,
            code_width IN NUMBER DEFAULT 1
            )
            IS
            v_str VARCHAR2 (200) := '';
            v_barstr VARCHAR2 (1) := '';
            v_barstrcode VARCHAR2 (10) := '';
            v_barstrcodeselect VARCHAR2 (10) := '';
            v_label VARCHAR2 (10) := '';
            x_pos NUMBER := 0;
            x_textstep NUMBER;
            x_bigstep NUMBER (10);
            x_smallstep NUMBER (10);
            x_width NUMBER := 0;
            y_height NUMBER;
            BEGIN

            -- setting values from the page to the internal PLSQL variables.

            v_str := UPPER (code39text);
            v_label := UPPER (code39label);
            y_height := (code_height);
            x_smallstep := (code_width);
            x_bigstep := 3 * (code_width);
            x_textstep := (x_smallstep * 6 + x_bigstep * 3) / 2;



            -- setting values from the page to the internal PLSQL variables.

            v_str := UPPER (code39text);
            v_label := UPPER (code39label);
            y_height := (code_height);
            x_smallstep := (code_width);
            x_bigstep := 3 * (code_width);
            x_textstep := (x_smallstep * 6 + x_bigstep * 3) / 2;

            -- generating header of svg file

            sys.OWA_UTIL.mime_header (ccontent_type => 'image/svg+xml',
            bclose_header => FALSE,
            ccharset => 'utf-8'
            );
            sys.HTP.p ('Cache-Control: no-cache');
            sys.OWA_UTIL.http_header_close;

            -- generating SVG file

            sys.HTP.p ('<?xml version="1.0" encoding="iso-8859-1"?>');
            sys.HTP.p ( '<svg width="100%" height="100%" xmlns="'
            || 'http://www.w3.org/2000/svg" '
            || 'xmlns:xlink="http://www.w3.org/1999/xlink"'
            || ' xmlns:a="http://ns.adobe.com'
            || '/AdobeSVGViewerExtensions/3.0/" >'
            );

            -- if I want to have label in the barcode,
            -- I need to declare style of text...

            IF v_label = 'YES'
            THEN
            sys.HTP.p ('<style type="text/css" >');
            sys.HTP.p ('<![CDATA[ ');
                  sys.HTP.p ('     .textlabel {font-size:8.0pt  ; '
                         || 'font-family:Helvetica}'
            );
            sys.HTP.p (' ]]>');
            sys.HTP.p (' </style> ');
            END IF;

            sys.HTP.p (' <g>');

            /*
            every char is internally coded to abcd codeing , that:
            a means thick black line in the barcode
            b means thin black line in the barcode
            c means thick white line (bigger space)
            d means thin white line (small space)
            */

            FOR i IN 1 .. LENGTH (v_str)
            LOOP
            v_barstr := SUBSTR (v_str, i, 1);
            v_barstrcode :=
            CASE v_barstr
            WHEN '1'
            THEN 'adbcbdbdad'
            WHEN '2'
            THEN 'bdacbdbdad'
            WHEN '3'
            THEN 'adacbdbdbd'
            WHEN '4'
            THEN 'bdbcadbdad'
            WHEN '5'
            THEN 'adbcadbdbd'
            WHEN '6'
            THEN 'bdacadbdbd'
            WHEN '7'
            THEN 'bdbcbdadad'
            WHEN '8'
            THEN 'adbcbdadbd'
            WHEN '9'
            THEN 'bdacbdadbd'
            WHEN '0'
            THEN 'bdbcadadbd'
            WHEN 'A'
            THEN 'adbdbcbdad'
            WHEN 'B'
            THEN 'bdadbcbdad'
            WHEN 'C'
            THEN 'adadbcbdbd'
            WHEN 'D'
            THEN 'bdbdacbdad'
            WHEN 'E'
            THEN 'adbdacbdbd'
            WHEN 'F'
            THEN 'bdadacbdbd'
            WHEN 'G'
            THEN 'bdbdbcadad'
            WHEN 'H'
            THEN 'adbdbcadbd'
            WHEN 'I'
            THEN 'bdadbcadbd'
            WHEN 'J'
            THEN 'bdbdacadbd'
            WHEN 'K'
            THEN 'adbdbdbcad'
            WHEN 'L'
            THEN 'bdadbdbcad'
            WHEN 'M'
            THEN 'adadbdbcbd'
            WHEN 'N'
            THEN 'bdbdadbcad'
            WHEN 'O'
            THEN 'adbdadbcbd'
            WHEN 'P'
            THEN 'bdadadbcbd'
            WHEN 'Q'
            THEN 'bdbdbdacad'
            WHEN 'R'
            THEN 'adbdbdacbd'
            WHEN 'S'
            THEN 'bdadbdacbd'
            WHEN 'T'
            THEN 'bdbdadacbd'
            WHEN 'U'
            THEN 'acbdbdbdad'
            WHEN 'V'
            THEN 'bcadbdbdad'
            WHEN 'W'
            THEN 'acadbdbdbd'
            WHEN 'X'
            THEN 'bcbdadbdad'
            WHEN 'Y'
            THEN 'acbdadbdbd'
            WHEN 'Z'
            THEN 'bcadadbdbd'
            WHEN '-'
            THEN 'bcbdbdadad'
            WHEN '+'
            THEN 'bcbdbcbcbd'
            WHEN '*'
            THEN 'bcbdadadbd'
            WHEN '/'
            THEN 'bcbcbdbcbd'
            WHEN '%'
            THEN 'bdbcbcbcbd'
            WHEN '.'
            THEN 'acbdbdadbd'
            WHEN '$'
            THEN 'bcbcbcbdbd'
            ELSE 'cccddddddd'
            END;

            FOR j IN 1 .. LENGTH (v_barstrcode)
            LOOP
            v_barstrcodeselect := (SUBSTR (v_barstrcode, j, 1));

            --drawing thick black line

            IF v_barstrcodeselect = 'a'
            THEN
            HTP.p ( '<rect height="'
            || y_height
            || '" width="'
            || x_bigstep
            || '" x="'
            || x_pos
            || '" y="0"/>'
            );
            x_pos := x_pos + x_bigstep;
            END IF;

            --drawing thin black line

            IF v_barstrcodeselect = 'b'
            THEN
            HTP.p ( '<rect height="'
            || y_height
            || '" width="'
            || x_smallstep
            || '" x="'
            || TO_CHAR (x_pos)
            || '" y="0"/>'
            );
            x_pos := x_pos + x_smallstep;
            END IF;

            --drawing thick white line

            IF v_barstrcodeselect = 'c'
            THEN
            x_pos := x_pos + x_bigstep;
            END IF;

            --drawing thin white line

            IF v_barstrcodeselect = 'd'
            THEN
            x_pos := x_pos + x_smallstep;
            END IF;
            END LOOP;

            -- write one char of label

            IF v_label = 'YES'
            THEN
            sys.HTP.p ( '<text class="textlabel" x="'
            || x_textstep
            || '" y="'
            || (y_height + 10)
            || '">'
            || v_barstr
            || '</text>'
            );
            END IF;

            x_pos := x_pos + x_smallstep;
            x_textstep := x_textstep + (x_smallstep * 6
            + x_bigstep * 3) + 3;
            END LOOP;

            sys.HTP.p (' </g>');
            sys.HTP.p (' </svg> ');
            END;
            End;



            I really appreciat any help on that.

            Thank you
            SH
            • 18. Re: Barcodes in HTMLDB - Question
              636948
              Hi,

              I am having trouble getting the barcodes to scan after being printed form my report in APEX. Can you please tell me how to get it to scan after printing the barcodes. Is there anything special has to be done on the printer driver or the client machine. Also hoe to encapsulated with an asterix in the front and the back. Second it needs an extra quiet space around it. what do you mean by that. I would appreciate any suggestions.

              Thank you,
              SF
              1 2 Previous Next