Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Numbering Breaks While Dynamically Inserting HTML On PDF #1582

Open
Beaconsilver opened this issue Mar 7, 2024 · 2 comments
Open

Page Numbering Breaks While Dynamically Inserting HTML On PDF #1582

Beaconsilver opened this issue Mar 7, 2024 · 2 comments

Comments

@Beaconsilver
Copy link

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
Copy link
Contributor

hvbtup commented Mar 7, 2024

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
Copy link
Contributor

@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 <VALUE_OF format="HTML"> and I included an AutoText Page n of m in the footer. I generated the PDF from the designer. Using BIRT 4.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants