Friday, February 18, 2011

Overflow / page break examples in Prawn PDF generation

I have been using Prawn for a while. Here I gather several overflow / page break examples.


1. Text paragraph overflow

Having several lines of text and I want whole block of text stick together


Solution is using group to hold them together



2. Table rows overflow

Sometime there is no enough space for the last table row when it reaches the end of page, and Prawn does not move it to next page. That's why we have to manually add a page break:



More code snippets available at https://gist.github.com/3dd13

2 comments:

  1. Thanks for the tip. I've just included in my code!

    ReplyDelete
  2. Really nice blog post.provided a helpful information.I hope that you will post more updates Ruby on Rails Online Course Bangalore

    ReplyDelete