Barcode Printing But Its Not Scanning

Mahanthesh

New Member
Hi I have created a program where i have to display a field as barcode. The barcode is getting printed in the page. But when i try to scan the same using scanner its not scanning.

The code sample is as follows.

RUN pdf_load_font ("Spdf","Code39","/0d/DevEE/code39.ttf","/0d/DevEE/code39.afm", "").
RUN pdf_set_font("Spdf","Code39",14.0).
RUN pdf_text_xy ("Spdf",STRING(field to be displayed as barcode), 222, 580 ).

I have tried with font Code128 as well. But the scanner doesnot read the barcode. Please help regarding the issue.
 

LarryD

Active Member
Try putting an "*" (asterisk) before and after your field to be barcoded, as it is required as far as I know in order to be read.

e.g.

RUN pdf_text_xy ("Spdf","*" + STRING(field to be displayed as barcode) + "*", 222, 580 ).
 

Mahanthesh

New Member
Hi LarryD,

Thank you for the reply. I tried the above suggested solution even then the scanner is not detecting the barcode .
If any other solution please let me know .

Thank you.
 

Cecil

19+ years progress programming and still learning.
I noticed in the CODE3of9 specs you can generate your own check sum digit. This is an optional requirement.

I wrote this code but not tested in anger.

Code:
function mod43CheckDigit RETURNS CHARACTER (input barCodeData AS CHARACTER):

    define variable checkDigit as character no-undo.
  
    define variable sum AS INTEGER NO-UNDO.
  
    define variable  characterValue AS CHARACTER INITIAL "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,-,., ,$,/,+,%".
  
    define variable i as integer no-undo.
  
    do I = 1 to length(barCodeData, "CHARACTER"):
  
      
       sum = sum + (LOOKUP( SUBSTRING(barCodeData,i,1,"CHARACTER")  , characterValue , ",") - 1).
      
    end.
  
    checkDigit = ENTRY( (sum MOD 43) + 1 , characterValue, ",").
  
    return  checkDigit .

end function.

message mod43CheckDigit ("+A123BJC5D6E71").
 
Last edited:

Cecil

19+ years progress programming and still learning.
I know some LCD and Laser scanners need to be programmed to allow which barcodes it will allow to scan. However I think you said that the scanner was previously working. Have you tried a mobile app scanner which can read code3of9.
 

LarryD

Active Member
AFAIK , check digits are not required for code39 (although use it if you need it).

I see that you are using PDF Include... we use it to generate code39 bar codes all the time for various customers, and have no issues.

The only difference from what you have we have is that we use a font size of 10 (not 14), and we set the X Y coordinates first then use pdf_text to do the actual bar code.

The only problems we've ever had is certain laser printers (especially if you are using draft mode or a non-laser printer) do not necessarily print the bar code in a readable manner, as there is bleeding between the bars that make it pretty much unreadable... however this is rare.

I agree with Cecil in that some scanners need to be set to read the specific bar code, and that you should try another device (barcode reader or mobile)
 
Top