-
Notifications
You must be signed in to change notification settings - Fork 18
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
NULL-byte #4
Comments
Well, it is trying to turn that string into a set of PDF417 codewords for barcode generation. I'm not sure what you want the end result to be, but with that initialization I wouldn't expect a scan to return Maybe you want to try using the
Or maybe
If that doesn't do it then it means digging into C code to fix it but I think the assumption you ran into is that it is passed a text string to be encoded, and that's a string with some very special characters. |
Can you please explain how to convert hex data I'm trying to pass into element of Thanks! |
Not any better than I have above - to set What happens when this barcode is scanned, a bunch of binary data comes back? |
I mean, How data in For example first element - length of array, what about other elements? Yes, after scan binary data comes back. |
Okay, looking at https://github.com/asee/pdf417/blob/master/ext/pdf417/pdf417.c#L189 and https://en.wikipedia.org/wiki/PDF417#Codewords it looks like the codewords should be integers and represent the binary data that has been encoded in the PDF417 format. This gem is a wrapper around a C library and looking at the method it uses to convert text to codewords it looks like it will occasionally try to use compact binary codeword substitutes, but that it expects text data - https://github.com/asee/pdf417/blob/master/ext/pdf417/pdf417lib.c#L520 |
You need to fix your code. Problem: you setting ruby string to char array using I've created a pull request to fix this, take a look. |
That is great, thank you very much! It makes a log of sense now that you point it out too... |
FYI, I bumped this up to 1.0.0, fixed some other errors that came up and released a new version of the gem |
👍 |
Trying to create barcode with data:
data = ['08', 'FF', '00', '01', 'E2', '25', '01', '00', '00', '00', '00', '00', '00', 'CF', '21', '09', '2C', '16', 'E1', 'A0', '12', 'CE', '18', '00', '00']
barcode = PDF417.new([data.join].pack("H*"))
barcode stops with length of 4
if I delete '00' it will go thru
barcode = PDF417.new([data.delete_if { |x| x == '00' }.join].pack("H*"))
Is there any way to pass the data?
The text was updated successfully, but these errors were encountered: