This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Formatting PDF with variable data

deepeshch wrote on 2015-01-06:
Hello,

After having read through all the suggested tricks on the forum to avoid and include forced page break to get the PDF to show correctly, we are close to what we need. But have one outstanding issue. Is there a way in the library to know if the content used in generating the PDF introduced an overflow page?
For example, most of the time the content in a table in our case would fit on one page. But we have seen customer examples when we see the table data overflows to two pages. Is there a way for us to know that there is an overflow? Or any other recommendation for us to programmatically decide if we need page-breaks?


Thanks for your help.
support wrote on 2015-01-07:
Hello,

Unfortunately there is no easy way how to handle this.

The library itself does not provide any information of this kind.

On the client side, one option could be to maintain the current content height (using JS) and use it to decide if there is an overflow.
deepeshch wrote on 2015-01-08:
Could you please elaborate the Client side solution you are proposing?
support wrote on 2015-01-08:
The idea is that you handle the overflow on the client side. You can write JS code which computes the table height and if the table is too long to fit one page, it modifies the page DOM to handle the overflow accordingly (split the table, ....).