eclipse-birt / birt

Eclipse BIRT™ The open source reporting and data visualization project.
http://www.eclipse.org/birt
Eclipse Public License 2.0
423 stars 387 forks source link

Page Numbering Breaks While Dynamically Inserting HTML On PDF #1582

Closed Beaconsilver closed 2 days ago

Beaconsilver commented 3 months ago

Auto text number and report parameter page numbering breaks if an html block is inserted dynamically

Currently using page numbering as a way to handle duplex printing. I generate a few hundred pages at a time. Duplex printing is a way to save some tree's in the process.

I do this by checking if the number of pages and the report can be divided by 2 and adding a blank page when needed - allowing duplex printing without mixing up the pages.

Now i have noticed that when the content of an html block is inserted at runtime from a database - if the block causes the page to overflow to the second page - the page numbering on PDF does not pick this up / breaking the duplex printing

This is only on PDF - generating the report and exporting to html keeps the numbering intact

hvbtup commented 3 months ago

Usually the PDF generation is done in a single RunAndRenderTask instead of separate RunTask and RenderTask. In this case, the report cannot know the current page number and the total page number. Maybe you can solve this in a different way, depending on how you integrated BIRT into your application. BIRT includes OpenPDF. If you find a chance to process your PDF after BIRT has generated it but before delivering it to the client or printer, you could write a little routine that obtains the number of pages from the PDF and, if it is odd, appends a blank page.

SteveSchafer-Innovent commented 3 months ago

@Beaconsilver, can you help me reproduce this? I tried generating enough HTML in javascript to overflow the page but it doesn't mess up the page numbering. I generated the HTML in a Text control in and I included an AutoText Page n of m in the footer. I generated the PDF from the designer. Using BIRT 4.14.

wimjongman commented 2 days ago

Closing because of no activity.