Created
September 12, 2011 23:04
-
-
Save kevinprince/1212725 to your computer and use it in GitHub Desktop.
badges in ruby
This file contains hidden or 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
require "prawn" | |
require "prawn/measurement_extensions" | |
Prawn::Document.generate("hello.pdf", | |
:page_size => "A5", | |
:page_layout => :landscape, | |
:margin => 0.mm | |
) do | |
bounding_box [0.mm, 148.mm], :width => 105.mm, :height => 148.mm do | |
bounding_box [5.mm, 105.mm], :width => 105.mm, :height => 220.mm do | |
font("Helvetica", :size => 36) do | |
text "Johnaton", :style => :bold | |
text "Doedeer", :style => :bold | |
end | |
font("Helvetica", :size => 16) do | |
text "@jdoe" | |
end | |
end | |
bounding_box [0.mm, 20.mm], :width => 95.mm, :height => 100.mm do | |
image "barcodes/barcode.png", :position => :right, :width => 40.mm, :height => 10.mm | |
end | |
end | |
bounding_box [105.mm, 148.mm], :width => 105.mm, :height => 148.mm do | |
bounding_box [5.mm, 105.mm], :width => 105.mm, :height => 220.mm do | |
font("Helvetica", :size => 36) do | |
text "Johnaton", :style => :bold | |
text "Doedeer", :style => :bold | |
end | |
font("Helvetica", :size => 16) do | |
text "@jdoe" | |
end | |
end | |
bounding_box [0.mm, 20.mm], :width => 95.mm, :height => 100.mm do | |
image "barcodes/barcode.png", :position => :right, :width => 40.mm, :height => 10.mm | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment