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

**URL:** <https://www.ruby-forum.com/t/how-to-start-new-pages-automatically-whenever-the-text-string-cannot-fit-on-the-current-page-in-praw/238546>\
**Category:** Rails\
**Created:** [January 16, 2014, 10:56am UTC](https://www.ruby-forum.com/t/how-to-start-new-pages-automatically-whenever-the-text-string-cannot-fit-on-the-current-page-in-praw/238546 "2014-01-16T10:56:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 16, 2014, 10:56am UTC](https://www.ruby-forum.com/t/how-to-start-new-pages-automatically-whenever-the-text-string-cannot-fit-on-the-current-page-in-praw/238546/1 "2014-01-16T10:56:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DHEERAJ\_CHILAPPAGAR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@DHEERAJ\_CHILAPPAGAR](https://www.ruby-forum.com/u/DHEERAJ_CHILAPPAGAR)\
**Post date:** [January 16, 2014, 2:41pm UTC](https://www.ruby-forum.com/t/how-to-start-new-pages-automatically-whenever-the-text-string-cannot-fit-on-the-current-page-in-praw/238546/2 "2014-01-16T14:41:17Z")

</div>

On 2014-Jan-16, at 04:45 , DHEERAJ CHILAPPAGARI  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

This is the default behavior of Prawn. You should find an example of  
exactly this in the manual.  
[http://prawn.majesticseacreature.com/manual.pdf](http://prawn.majesticseacreature.com/manual.pdf)

-Rob

Rob B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
