ConversionOptions.Header Property
Gets or sets Header
public string Header { get; set; }
Public Property Header As String
Property Value
Licensing Info
This property is a DynamicPDF HTML Converter feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF HTML Converter for .NET v2.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
Following code will add a header with the URL on left side and total number of pages on right side of the header.ConversionOptions conversionOptions = new ConversionOptions(PageSize.A4, PageOrientation.Portrait, 20);
conversionOption.Header = "<div style='text-align:left; display:inline-block; padding-right:1em; font-size:15em;'><span class='url'></span></div>"
+ "<div style = 'text-align:center; display:inline-block; padding-right:1em; font-size:15em;'></div>"
+ "<div style = 'text-align:right; display:inline-block; padding-right:1em; font-size:15em;'><span class='totalPages'></span></div>";
Remarks
Default is an empty string which generates no header. Assigning null to this property will generate default header by the browser. HTML template for the print header should be valid HTML markup with following classes used to inject printing values into them:
-
date: formatted print date title: document title url: document location pageNumber: current page number totalPages: total pages in the document
{span class=title}{/span}
would generate span containing the title.