Skip to content

Instantly share code, notes, and snippets.

@jordanbyron
Created August 21, 2009 13:19
Show Gist options
  • Save jordanbyron/171986 to your computer and use it in GitHub Desktop.
Save jordanbyron/171986 to your computer and use it in GitHub Desktop.
Prawn::Document.generate('labels.pdf', :left_margin => 0.21975.in, :right_margin => 0.21975.in) do |p|
p.define_grid(:columns => 3, :rows => 10, :column_gutter => 10)
p.grid.rows.times do |i|
p.grid.columns.times do |j|
b = p.grid(i,j)
p.bounding_box b.top_left, :width => b.width, :height => b.height do
p.text b.name
p.stroke do
p.rectangle(p.bounds.top_left, b.width, b.height)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment