anujluthra / barcode-generator Goto Github PK
View Code? Open in Web Editor NEWRails plugin to generate/display barcode in your views
Rails plugin to generate/display barcode in your views
suggest you update the link in the README to reflect the fact that the ruby 1.9 version is now at https://github.com/ahx/gbarcode
Barcode helper alters supplied id, makes it upper-case, which is bad behavior
Love how easy this make barcode creation but I have a problem displaying the barcode. I had some trouble getting everything installed but now I can generate an eps file just fine but it fails to create the png file and display the barcode in the view. I get this error:
ActionView::Template::Error (undefined method join' for #<Enumerator: []:collect>): 9: <%= @label.description %> 10: </p> 11: 12: <p><%= barcode @label.code %></p> 13: 14: <p> 15: <%= link_to "Edit", edit_label_path(@label) %> | app/views/labels/show.html.erb:12:in
_app_views_labels_show_html_erb___1939771989001282335_2169264860_1747278781368551234'
When I run the tests, it points back to barcode_generator/lib/imagemagickwrapper.rb
system("convert #{options.collect.join(' ')} #{src} #{out}")
The error says Enumerable doesn't have a method 'join'.
When I run convert from the command line with no options, it creates the png file. When I remove options from the imagemagickwrapper.rb line, the barcode displays fine in the view.
I'm not well-versed in ruby innards so I'm not attempting a fix, just reporting.
I'm using ruby 1.9.2
rails 3.0.9
imagemagick 6.7.1-1
gbarcode for ruby 1.9
Thanks for any help,
Will Emerson
It should be useful to have :cache option to allow disabling image caching. I'm using this plugin for the project, which requires dynamic adaptation of code image for different mobile devices, so default code image caching doesn't work for me.
Most barcode printers print at 300dpi to allow for a decent quality that barcode readers need in case of small barcode labels.
Would it be possible to have a resolution option to specify the resolution for the generated barcodes?
Love the plug-in otherwise!
Cheers J.
Hi Anuj,
This is a great plugin that I'm using for a project. I have run into an issue that a barcode image generated on one view will also be used for a second view where different parameters (width, height, etc) are passed but not utilized (it's the same larger image).
Looking at the code in /lib/barcode_generator.rb file I found this line:
unless File.exists?(out)
Which I commented out to allow the image to be regenerated each time, but this is not the case. It still operates as before. The first time the image is generated, it received the parameters according to the view page that was called first, and then used for all others.
Is there another way to get around this and have the image generated differently in different views?
Thanks,
Alan.
I am using rails 3.1 and ruby 1.9.2 while I am using the
<%= barcode("Text",:encoding_format=>Gbarcode::BARCODE_CBR) %>
Then it is creating a blank png image with name TEXT.png.
I am not getting any image ,while I am using this constant BARCODE_128 then it is creating.
But in the documentation it is said that these formats are supported now..?
how to install gbarcode and then barcode-generator?
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.