Welcome Guest Search | Active Topics | Sign In | Register

Combining pages during print: best way to update page numbers / totals? Options
Rabobank Support
Posted: Tuesday, May 26, 2015 8:43:25 AM
Rank: Newbie
Groups: Member

Joined: 10/20/2014
Posts: 9
Hello forum,

we're currently dealing with a setup where multiple parts of our document have to be rendered in landscape mode. We came up with the solution of splitting up the document in multiple pages, rendering them, and combining them into one PdfDocument.

This leads to the problem however that the page numbers and the total page count are wrong. Our footers look like "Page {page_number} of {total_pages}". Which each merged page the page_number starts at 1 (which can be fixed in the options), and the total_pages count is off.

Is there a way to fix the total_pages problem? Maybe by deactivating footer generation in the first pass and re-running it on the whole document?

Thanks in advance!
Rabobank Support
Posted: Tuesday, May 26, 2015 9:04:35 AM
Rank: Newbie
Groups: Member

Joined: 10/20/2014
Posts: 9
Fixed it. It's mentioned in a foot note in the "Page Header and Footer" article.
I do not output a footer in the first place, then loop through the pages, but instead of doing what the support article says, i simply format the footer myself (string.replace for page number and total pages), then place that into the HtmlToPdfOptions, and render an empty html string. This way I don't have to fiddle with output areas, etc.
eo_support
Posted: Tuesday, May 26, 2015 10:20:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Great. Glad to hear that you got it working! Please feel free to let us know if you have any more questions.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.