Welcome Guest Search | Active Topics | Sign In | Register

Excluding the Header and Footers from the first page when converting from HTML to PDF Options
bogden
Posted: Wednesday, March 22, 2017 4:52:07 PM
Rank: Newbie
Groups: Member

Joined: 10/15/2013
Posts: 2
How do I exclude the header and footer from the first page when converting from HTML to PDF? We need to create a title page, which does not have the header and footer on it
eo_support
Posted: Wednesday, March 22, 2017 8:00:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You would just use a loop to loop over other pages and add header/footer with code. See here for more details:

https://www.essentialobjects.com/doc/pdf/htmltopdf/header.aspx#after

Look for "Adding Page Header/Footer After the Conversion". The sample code loops from 0 so the footer is added to all pages. If you want to skip the first page, you would just loop from 1.

Please let us know if you still have any questions.

Thanks!
bogden
Posted: Thursday, March 23, 2017 2:53:10 PM
Rank: Newbie
Groups: Member

Joined: 10/15/2013
Posts: 2
Thanks for the quick reply. Ok, so there isn't a way to do this in the HtmlToPdf.Options? I'm worried about the performance when converting the header on every page. We have some documents that are rather long. However, we can make it work if that's the best way.

Thanks again
eo_support
Posted: Friday, March 24, 2017 2:38:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

Thank you very much for your feedback. We have posted a new build that added this property for this purpose:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.firstheaderfooterpageindex.aspx

You would set this property to the number of pages you want to skip. For example, if you want to skip the first two pages, then you would set this property to 2.

You can download the new build from our download page. Please feel free to let us know if you have any questions.

Thanks


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.