|
Rank: Newbie Groups: Member
Joined: 11/6/2018 Posts: 9
|
Hi,
maybe overlooking the obvious, but can't seem to find any hint on this one. Using eo for a number of years now with htmltopdf functionality, but now I'm looking for a way to use a single page pdf document (empty, only with a logo and some text on it in the footer) to add the html content. I use the css pagebreak functionality, so for every new pdf page needed, it should use the base pdf file to write on.
thx!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
You will need to do this by calling the converter twice. The basic steps are:
1. Calling the converter once. The purpose of the this run is to find out how many pages the output will be; 2. Using PdfDocument.Merge to generate a template PDF file that contains exactly that number of pages using your one page template file; 3. Calling the converter again and pass the result PdfDocument you generated in step 2 as the output PdfDocument;
Hope this makes sense to you. Please feel free to let us know if you still have any questions.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/6/2018 Posts: 9
|
Oke that got me on my way, tried the steps:
1. the converter generates 4 pages in doc1 2. I merge my empty template page doc2 to a new pdfdocument doc3 4 time with a loop 3. I call the converter again and use doc3 to put the html content in it
the result is a pdf with 4 empty template pages (page 1-4) and 4 pages (page 5-8) with the url content on it but not over my template page. Can you give a basic code example?
thx!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
Please try to set HtmlToPdf.Options.StartPageIndex to 0.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/6/2018 Posts: 9
|
Yep, that did it thx for the help!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Great!
|
|