I'm trying to generate a pdf using Prawn 0.12.0.
The content I am rendering is very dynamic and often spans over multiple pages.
The problem I'm having is that when it starts a new page automatically the current bounding box "breaks".
The text that renders on the new page does not have the correct bounding box.
If I use stroke_bounds I can see the bottom stroke at the very bottom of the page.
I've read about this problem on various forums but can't seem to figure out what is actually happening.
Here is the specific code that loops out the content:
items.each do |item|
group do
title_text = [{ text: item.title, styles: [@heading_style], size: 11}]
formatted_text title_text
text(item.description, size: 9)
stroke { line(bounds.bottom_left, bounds.bottom_right); }
end
end
As you can se I want to draw a line just below every item and that is why I need the current bounding box to be correct.
groupmethod in your code:NotImplementedError: Document#group has been disabled because its implementation lead to corrupted documents whenever a page boundary was crossed. We will try to work on reimplementing it in a future release- iconoclast