Jump to content
boris.nihil

pdf417

Recommended Posts

Does anybody have experience with 2d barcode, TurboPower SysTools, component StPDF417Barcode...

I can't add StPDF417Barcode1.code = '...' witch contains some local letters (ŠĐČĆŽš), it says 

"Range check error"...

 

virm_grad ,virm_adresa ,virm_naziv:string;

 

virm_naziv  := utf8encode('dsdddddd');
  virm_adresa := utf8encode('ŠĐŠĐČĆĆČĆČ');
  virm_grad := utf8encode('špšpUIZUZUZ');

 

  StPDF417Barcode1.Code := 'HRVHUB30' + #13#10 + 'EUR' + #13#10 +
    virm_naziv + #10 +
    virm_adresa + #10 +
    virm_grad + #10;

 

Share this post


Link to post

in instructions PDF, they say:

Simbol UTF-8 Hex
Č          C4 8C
č           C4 8D
Ć           C4 86
ć           C4 87
Đ          C4 90
-------------------------

how to use it in delphi code ?
 

Share this post


Link to post

The Wikipedia page @Lajos Juhász linked clearly explains you cannot use anything else other that a..z and A..Z:

 

image.thumb.png.6a58a4ee01d4d65a8f53ae3e30a5c4fa.png

 

As for UTF8 that is used in PDF documents, which is not the same as the barcode format.

Share this post


Link to post

Looking at the source code and the error it looks like it tries to use text mode which then fails since that mode supports a limited set of characters. It uses some internal functions to test what mode it should use based on the input string but gets it wrong with your strings. 

 

The component does support an extended syntax where the bytes can be represented directly in the string using escape codes \ddd so you could convert the whole string to a UTF8string then build a string to input by escaping each byte value in the UTF8 string into the input string. Not as easy as it sounds due how Delphi tries to help with strings. No luck trying to get this to work either- Delphi really fights too hard and the docs do not help any. 

 

Copied St2DBarC.pas to the project directory and modified the GoodForNumericCompaction and GoodForTextCompaction by commenting out everything but the first line's Result := False; This forces binary mode. Still making sure the correct bytes are encoded seems iffy as the barcode looks too wide after passing in just \196\140. 

Edited by Brian Evans

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×