Created
October 15, 2011 15:57
-
-
Save house9/1289751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile, run bundle install after adding | |
gem 'barby' | |
gem 'chunky_png' | |
# some code to generate the png file using 3 of 9 barcode style | |
require 'barby' | |
require 'barby/barcode/code_39' | |
require 'barby/outputter/png_outputter' | |
barcode_value = "099999333" | |
full_path = "/somewhere/barcode_#{barcode_value}.png" | |
barcode = Barby::Code39.new(barcode_value) | |
File.open(full_path, 'w') { |f| f.write barcode.to_png(:margin => 3, :xdim => 2, :height => 55) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment