ConversionOptions.Header Property
Gets or sets Header
public string Header { get; set; }
Public Property Header As String
Property Value
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.