Aspose.PDF generating page breaks after problem section

What is happening is that in our grant application/reporting system, occasionally we will have the issue where, after a certain “problem” section, the remainder of the document has page breaks generated where there should be no page break. At time we end up with a document that should be 20 pages stretching to over 100 pages, most of these blank. The attached code replicates this issue. After the “Promotional Materials” section, the following sections generate a page break after the second text bit that is inserted. This seems to happen in this particular case when you insert a link at the very bottom of a page. If you decrease the number of Promotional Materials items written, this issue goes away. Since in production these sections are of varying lengths depending on what the user has entered, we can’t know when this issue might occur. Please take a look at this and let us know of a fix.

Thanks.

Laurie

p.s. Using Aspose.Pdf version 8.9.1.0

Hi Laurie,


Thanks for your inquiry. After initial investigation we have noticed the issue. Please note old generator (Aspose.Pdf.Generator) is almost obsolete now, we have ported all features to new generator (Aspose.Pdf.Document) and we recommend to use new generator. We are converting your code to new DOM approach (Aspose.Pdf.Document), will test the scenario again and share our findings with you soon.

We are sorry for the inconvenience caused.

Best Regards,

Hi. It’s been over a year and this has apparently fallen off both of our radars. This has been an ongoing issue in which we’ve had to walk the users through either removing or changing a table row. It has been do-able, but we would prefer a solution that would not require this hand-holding. You indicated that you’d convert my code to the new DOM approach. Would you be able to do this anytime soon?


Thanks.

Laurie

p.s. Currently using Aspose.PDF version 10.8.0.0.

Hi Laurie,


I am sorry for missing this. I will convert your code to new DOM soon and will share the details here.

Best Regards,

Hi Laurie,


Thanks for your patience. I have converted your old generator(Aspose.Pdf.Generator) sample code to new generator(DOM) and it is working fine. Please find attached sample project, it is generating PDF document without blank pages. Hopefully it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,