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!
|
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.
|
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.
|