Skip to content

Instantly share code, notes, and snippets.

@AndrewO
Created October 12, 2009 06:39
Show Gist options
  • Save AndrewO/208197 to your computer and use it in GitHub Desktop.
Save AndrewO/208197 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'barby'
require 'prawn'
require 'barby/outputter/prawn_outputter'
CODES = %w{1255145144147676 1255147506745571}
def write_pdf(code)
Prawn::Document.generate("#{code}.pdf") do |pdf|
puts "code: #{code}"
barcode = Barby::QrCode.new(code)
barcode.annotate_pdf(pdf)
end
end
CODES.each {|c| write_pdf(c)}
/Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:296:in `map_data': undefined method `rszf' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:291:in `each'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:291:in `map_data'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:287:in `step'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:287:in `map_data'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:172:in `make_impl'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:196:in `get_best_mask_pattern'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:195:in `each'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:195:in `get_best_mask_pattern'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:145:in `make'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:85:in `initialize'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/barcode/qr_code.rb:89:in `new'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/barcode/qr_code.rb:89:in `rqrcode'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/barcode/qr_code.rb:55:in `encoding'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/outputter.rb:81:in `encoding'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/outputter.rb:92:in `boolean_groups'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/outputter/prawn_outputter.rb:24:in `annotate_pdf'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/barcode.rb:70:in `send'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/lib/barby/barcode.rb:70:in `method_missing'
from barby_bug_test.rb:20:in `write_pdf'
from /Library/Ruby/Gems/1.8/gems/prawn-core-0.5.1/lib/prawn/document.rb:173:in `[]'
from /Library/Ruby/Gems/1.8/gems/prawn-core-0.5.1/lib/prawn/document.rb:173:in `initialize'
from /Library/Ruby/Gems/1.8/gems/prawn-core-0.5.1/lib/prawn/document.rb:96:in `new'
from /Library/Ruby/Gems/1.8/gems/prawn-core-0.5.1/lib/prawn/document.rb:96:in `generate'
from barby_bug_test.rb:10:in `write_pdf'
from barby_bug_test.rb:24
from barby_bug_test.rb:24:in `each'
from barby_bug_test.rb:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment