-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
I am struggling with an unwanted page break in a table. The contents of the cells varies in length. It seems some specific combinations of text length trigger the page break. Some much longer texts are displayed without a page break.
Here is the shortest snippet I found that has the page break. (I'm not using the font_size change in my app, it just happens to trigger the problem here.)
require 'rubygems'
require 'prawn/core'
require 'prawn/layout'
Prawn::Document.generate("problem.pdf") do
@table = [[
Prawn::Table::Cell.new(:text => "Some text with overflow.\nAnother line"),
Prawn::Table::Cell.new(:text => 'foo'),
]]
(8..9).each do |i|
table @table, {:column_widths => { 0 => 100, 1 => 100}, :font_size => i}
end
end
This happened in 0.5; I've built the gem from github and it's the same.