Skip to content

Instantly share code, notes, and snippets.

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