How to start new pages automatically whenever the text string cannot fit on the current page in prawn

427 Views Asked by At

I am trying to generate a PDF invoice using prawn with header, body and footer. The content of the body may change. I'm using bounding_box to place content in the body. If the content cannot fit on the current page body, it should automatically place the remaining content in body portion of the new page. Please help me with the coding.

1

There are 1 best solutions below

0
On

Use the span() method rather than bounding_box(). This will allow you to set the width of your text block, but it will reflow to the top of the page when you start a new page.