Skip to content

Instantly share code, notes, and snippets.

@makenai
Created October 14, 2011 14:56
Show Gist options
  • Save makenai/1287340 to your computer and use it in GitHub Desktop.
Save makenai/1287340 to your computer and use it in GitHub Desktop.
Fuzzy QR code
require 'rubygems'
require 'rghost'
require 'rghost_barcode'
RGhost::Config::GS[:path] = '/usr/local/bin/gs'
RGhost::Config::GS[:unit] = RGhost::Units::Inch
doc = RGhost::Document.new :paper => [3,2] # 3"x2" label
doc.barcode_code39( '1234567', :x => 0.45, :y => 0.125, :width => 1.75, :height => 0.35, :rotate => 90 )
doc.barcode_qrcode('http://usrlib.org/media/1234567', :x => 1, :y => 0.125, :eclevel => 'H', :width => 1.5, :height => 1.5 )
doc.render :pdf, :resolution => 100, :filename => 'label.pdf'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment