Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues in scanning generated pdf417 barcode #48

Open
Piyushchandra1987 opened this issue Jun 5, 2015 · 2 comments
Open

Issues in scanning generated pdf417 barcode #48

Piyushchandra1987 opened this issue Jun 5, 2015 · 2 comments

Comments

@Piyushchandra1987
Copy link

Additional information for #47
I have added a sample program in Pdf417Barcode

Here is sample program I am using
code file

barcode_data = "Test Barcode"
postal_barcode = Barby::Pdf417.new(barcode_data)
image = Barby::PngOutputter.new(postal_barcode).to_png
File.open('barcode.png', 'w'){|f| f.write image }

you can check generated barcode

I am able to scan barcode generated by java library using
java Pdf417lib test_barcode.ps "Test Barcode"

OS : Mac OS X Yoesmite 10.10.3
Jruby version : jruby 1.7.20 (1.9.3p551) 2015-05-04 3086e6a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 +jit [darwin-x86_64]
Gems Used

for verifying I am using this site Online Barcode Decoder

and Barcode scanners by manatee Works on my android phone

@Piyushchandra1987
Copy link
Author

Finally found the issue. In Pdf417 class in encoding method while parsing the byte stream we have to remove first bit from output of sprintf("%08b", (byte & 0xff) | 0x100) .

I have overriden encoding method of Pdf417 class to solve it. Here is my implementation

byte stream before removing first bit
111111111101010100101111101101001111110110101100001100100011101101011100100001111111101000110100100

byte stream after removing first bit
1111111101010100011111010100111110110101000011000001110101011100000011111110100010100100

now i am able to scan the generated barcode.

@PetrKaleta
Copy link

Had same issue +1 for superb solution!!!!

Kudos Piyushchandra1987

gordysc added a commit to gordysc/barby that referenced this issue Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants