Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf.ConvertHtml First Page bottom margin Options
Tyler Miller
Posted: Thursday, July 8, 2021 1:29:26 PM
Rank: Advanced Member
Groups: Member

Joined: 1/22/2014
Posts: 38
I am trying to get only the first page generated using HtmlToPdf.ConvertHtml to have a bottom margin in inches. This is not working

@page :first {
margin-right: 2.5in;
}

Question: Is there a way to set only the first page to have a bottom margin in inches when using HtmlToPdf.ConvertHtml.
eo_support
Posted: Saturday, July 10, 2021 12:15:15 PM
Rank: Administration
Groups: Administration

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

You won't be able to have different page settings for different pages because the first page's page style settings are used for all pages. One way you can work around this limitation is to set HtmlToPdf.Options.StartPosition to have extra margin at the top for the first page first. Then after you complete the conversion, you can use this method:

https://www.essentialobjects.com/doc/eo.pdf.pdfpage.transform.aspx

To apply a transform on the entire first page to shift everything upwards. This way you will have extra margin at the bottom.

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.