asee / pdf417 Goto Github PK
View Code? Open in Web Editor NEWA Ruby wrapper for the PDF417 barcode library
License: MIT License
A Ruby wrapper for the PDF417 barcode library
License: MIT License
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?
Hi,
I'm the author of Barby [1], a wrapper for multiple barcode symbologies in Ruby. We're currently working on getting proper PDF417 support in place; currently, there's only a vendored Java version available. What I have in mind is to take out the Java bits, merge them with the C version and release this as a separate gem. We have some of it in place already [2], but I think it would be silly if there were two very similar gems for doing PDF417, and it seems you've already done a bit of work on this one..
So here's my question: Would you be open to a PR which merges in some Java bits along with the necessary scaffolding to make it work the same as the C version (AFAIK it's a port). I think it could be done quite cleanly. It would in reality become two gems, but AFAICT RubyGems handles this transparently so that it does not affect the end user, they get the version they're supposed to have. The (existing) wrapper class just requires the "lib" class as usual, which will be either C or Java.
[1] http://github.com/toretore/barby
[2] https://github.com/Keeguon/barby-pdf417
I started seeing this error: LoadError: cannot load such file -- pdf417/pdf417
.
In case anyone else finds this, it was because ext/pdf417/extconf.rb
contained create_makefile(extension_name)
(which resolves to create_makefile('pdf417')
.) This now needs to be create_makefile('pdf417/pdf417')
in order for require('pdf417/pdf417')
to work properly.
I fixed this issue in our fork: https://github.com/DocSpring/pdf417
PDF417.new(text: '').to_blob
would segfault. A simple fix may be just rasing error on empty string. I also look at other 2d barcode. It seems that QR Code is able to encode empty string. Not sure how PDF417 should handle this corner case.
running ruby 1.9.2 ala RVM, get this error. From the looks of it, it was removed in ruby 1.9 in favor of StringValuePtr i believe... frankly a level of programming still outside of my skillset (otherwise i'd happily fix myself!)
Through some trial and error and clues left hanging in the interwebs, I only got it to work as follows by using to_png...
barcode = PDF417.new("my data to encode")
data = StringIO.new(barcode.to_png)
pdf.image(data)
Hi there,
I using this Gem to generate PDF417 barcode png. It works as expected, though the output image is different from those generated by online barcode generators. Just wondering if there is any other variance to this barcode format or if there is anything I need to be aware of when setting up the option arguments. Thanks.
Here is an example generated by the gem and the code for it.
PDF417.new(barcode_text,aspect_ratio: 0.9).to_png(margin: 0, x_scale: 1, y_scale: 28)
And here is another example from the online generator with same data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.