Created
February 6, 2009 17:45
-
-
Save wesmaldonado/59521 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
require "rubygems" | |
require "prawn" | |
require "prawn/measurement_extensions" | |
Prawn::Document.generate("badge_printing.pdf", :margin_top => 0.5.in) do | |
# our start_x position for the columns | |
[0.5, 4].each do |column_width| | |
# spacing between each "badge" | |
move_down 0.5.in | |
5.times do | |
bounding_box [column_width.in, cursor], :width => 3.0.in, :height => 1.5.in do | |
# do what you want within this box | |
move_down bounds.height/2 | |
font_size 16 | |
text "John Smith", :align => :center | |
font_size 12 | |
text "job title", :align => :center | |
text "\"personal quote\"", :align => :center | |
stroke_bounds | |
end | |
stroke_bounds | |
# spacing between the badges | |
move_down 0.3.in | |
end | |
# next column, back to the top | |
move_up bounds.top - cursor | |
end | |
end | |
`open badge_printing.pdf` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment