Skip to content

Instantly share code, notes, and snippets.

@amoeba
Created October 28, 2009 05:19
Show Gist options
  • Save amoeba/220265 to your computer and use it in GitHub Desktop.
Save amoeba/220265 to your computer and use it in GitHub Desktop.
require 'prawn'
require 'prawn/layout'
Prawn::Document.generate("prawn-table-height.pdf") do
data = [["This is a line"]] * 10
row_height = font.ascender - font.descender + font.line_gap
10.times do |i|
stroke_rectangle([0, bounds.top - (i * row_height)], 100, row_height)
end
table(data,
:font_size => 12,
:vertical_padding => 0,
:horizontal_padding => 0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment