#1 Lost byte


Hello there,

I use PDF417 lib to create barcode based on the
following scheme: every field has a tag id byte, a length
byte and content. Everything works perfectly fine
except for some data. Sometimes, I lose a tag id byte
(that makes my barcode unreadable): in binary, the
corresponding sequence looks like: ... 31 31 31 26 09 31
31 31 31 31 31 31 31 31 27 10 31 31 31 ....
The read barcode has skipped the 26. I tried debugging
the pdf417lib class and I got that: in the "breakstring"
method of Pdf417lib class, the first "... 31 31 ..."
sequence is seen as a text segment "T". The 26 is seen
as a 1-byte long binary segment "B" and the "09 31 31
31..." as another text segment. However, in the
optimizing loops (still in Pdf417lib class), the 1-byte long
segment is merged and finally lost. That is why I do not
get this byte when I read the generated barcode.

Please, let me know if I am not correctly using the
library (maybe specifications do not allow 1-byte long
segments) or if that byte should be included in the

Thanks a lot.


  • eli napchan

    eli napchan - 2004-10-05

    Logged In: YES

    Where is the pdf417lib class?
    Could you give an example of input that works ok, and input
    that has this problem?

  • Nobody/Anonymous

    Logged In: NO

    I use the java version of the pdf417 project.
    I join an example of my problem. You'll find source code of a
    test application including 2D barcode pdf417 library in the src
    directory. In the test directory, you'll find a binary file used as
    input (BarcodeTest.bin), the barcode image generated from
    that input (BarcodeTest.jpg) and an output binary file (data
    read from the barcode image, in BarcodeTestResult.bin).
    You'll see the "26" byte is missing in the last file.

    Then, you can use the previous output file as an input,
    generate the barcode and read it. The second output file will
    be ok.

    I hope it will help you.


  • eli napchan

    eli napchan - 2004-10-08

    Logged In: YES

    I am interested in the C version of the library.

    Could try to test it with the example that you provided,
    but, could not get access to the source code that you have
    uploaded. If you think this could be useful please explain
    how to get to your test files.


  • Nobody/Anonymous

    Logged In: NO

    I tried uploading sample and test files on this bug declaration
    but I did succeed. I have created a new bug (Lost byte
    continuation) where I uploaded the files (it is named
    BarcodeTester.zip). I think you can download it easily.

  • Nobody/Anonymous

    Logged In: NO

    Hi there,

    I'd just like to know if someone is looking at that bug I posted
    some weeks ago. I uploaded the source files as well as an
    example on another bug declaration (Lost Byte continuation).

    Eli, could you please tell me if you got the example to test
    with the C version of the library.


  • Paulo Soares

    Paulo Soares - 2005-03-18
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks