Rank: Newbie Groups: Member
Joined: 12/18/2018 Posts: 3
|
Here is simple content I am using to set to header content.
HtmlToPdf.Options.HeaderHtmlFormat = "<span style="font-family: arial; font-size: 45px; font-weight: bold;border:red 1px solid;">Test Report</span>";
PDF is getting generated with different fonts based on the body content font. I generated two different contents one has generated with header with 24.5 px and another one with 26 px.
Please suggest, is there any way to generate based on the input font in header.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi, This behavior is by design. The reason is the header/footer would use the same zoom level as the main contents so that it can be consistent with the main contents (for example, text with font-size:45px in the header/footer would be displayed the same size as text with font-size:45px in the main contents). This means if you have multiple conversions that uses different zoom level (which is very common because by default the zoom level is automatically adjusted), then header footer would have different sizes. If this is not the desired result, you can either explicitly fix the zoom level or use a separate HtmlToPdf.ConvertHtml to stamp the header/footer after the conversion. You can find more information about zoom level here: https://www.essentialobjects.com/doc/pdf/htmltopdf/auto_fit.aspxThanks!
|