Class IEConverterSettings
Class which represents the settings of IE rendering engine
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.HtmlConverter
Assembly: Syncfusion.HtmlConverter.Base.dll
Syntax
public class IEConverterSettings : IHtmlConverterSettings
Remarks
To know more details about IE rendering engine, refer this link.
Examples
//Initialize HtmlToPdfConverter class with IE rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(RenderEngine.IE);
//Setting properties for IE conversion.
IEConverterSettings ieSettings = new IEConverterSettings();
ieSettings.AdditionalDelay = 1000;
ieSettings.AspectRatio = AspectRatio.KeepWidth;
ieSettings.AutoDetectPageBreak = true;
ieSettings.ClearInternetCache = true;
ieSettings.EnableActiveXControl = true;
ieSettings.EnableBinaryBehaviors = true;
ieSettings.EnableHyperLink = true;
ieSettings.EnableJavaScript = true;
ieSettings.IsPDFA1B = false;
ieSettings.IsTaggedPDF = false;
ieSettings.Margin = new PdfMargins { All = 40 };
ieSettings.Orientation = PdfPageOrientation.Portrait;
ieSettings.Password = "";
ieSettings.Username = "";
htmlConverter.ConverterSettings = ieSettings;
//Convert HTML to PDF.
PdfDocument pdfDocument = htmlConverter.Convert("http://www.google.com");
//Saving and closing PDF document
pdfDocument.Save("Output.pdf");
pdfDocument.Close(true);
'Initialize HtmlToPdfConverter class with IE rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(RenderEngine.IE)
'Setting properties for IE conversion.
Dim ieSettings As New IEConverterSettings()
ieSettings.AdditionalDelay = 1000
ieSettings.AspectRatio = AspectRatio.KeepWidth
ieSettings.AutoDetectPageBreak = True
ieSettings.ClearInternetCache = True
ieSettings.EnableActiveXControl = True
ieSettings.EnableBinaryBehaviors = True
ieSettings.EnableHyperLink = True
ieSettings.EnableJavaScript = True
ieSettings.IsPDFA1B = False
ieSettings.IsTaggedPDF = False
ieSettings.Orientation = PdfPageOrientation.Portrait
ieSettings.Password = ""
ieSettings.Username = ""
htmlConverter.ConverterSettings = ieSettings
'Convert HTML to PDF.
Dim pdfDocument As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Saving and closing PDF document
pdfDocument.Save("Output.pdf")
pdfDocument.Close(True)
Constructors
IEConverterSettings()
Initializes a new instance of the IEConverterSettings class.
Declaration
public IEConverterSettings()
Remarks
To know more details about IE rendering engine, refer this link.
Examples
//Initialize HtmlToPdfConverter class with IE rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(RenderEngine.IE);
//Setting properties for IE conversion.
IEConverterSettings ieSettings = new IEConverterSettings();
ieSettings.AdditionalDelay = 1000;
ieSettings.AspectRatio = AspectRatio.KeepWidth;
ieSettings.AutoDetectPageBreak = true;
ieSettings.ClearInternetCache = true;
ieSettings.EnableActiveXControl = true;
ieSettings.EnableBinaryBehaviors = true;
ieSettings.EnableHyperLink = true;
ieSettings.EnableJavaScript = true;
ieSettings.IsPDFA1B = false;
ieSettings.IsTaggedPDF = false;
ieSettings.Margin = new PdfMargins { All = 40 };
ieSettings.Orientation = PdfPageOrientation.Portrait;
ieSettings.Password = "";
ieSettings.Username = "";
htmlConverter.ConverterSettings = ieSettings;
//Convert HTML to PDF.
PdfDocument pdfDocument = htmlConverter.Convert("http://www.google.com");
//Saving and closing PDF document
pdfDocument.Save("Output.pdf");
pdfDocument.Close(true);
'Initialize HtmlToPdfConverter class with IE rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(RenderEngine.IE)
'Setting properties for IE conversion.
Dim ieSettings As New IEConverterSettings()
ieSettings.AdditionalDelay = 1000
ieSettings.AspectRatio = AspectRatio.KeepWidth
ieSettings.AutoDetectPageBreak = True
ieSettings.ClearInternetCache = True
ieSettings.EnableActiveXControl = True
ieSettings.EnableBinaryBehaviors = True
ieSettings.EnableHyperLink = True
ieSettings.EnableJavaScript = True
ieSettings.IsPDFA1B = False
ieSettings.IsTaggedPDF = False
ieSettings.Orientation = PdfPageOrientation.Portrait
ieSettings.Password = ""
ieSettings.Username = ""
htmlConverter.ConverterSettings = ieSettings
'Convert HTML to PDF.
Dim pdfDocument As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Saving and closing PDF document
pdfDocument.Save("Output.pdf")
pdfDocument.Close(True)
Properties
AdditionalDelay
Gets or sets the additional delay to load JavaScript;
Declaration
public int AdditionalDelay { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Specifies the delay to load the scripts.Unit is Milliseconds; By default 0 |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set Additional delay for conversion
ieSettings.AdditionalDelay = 1000;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set Additional delay for conversion
ieSettings.AdditionalDelay = 1000
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
AspectRatio
Gets or sets the aspect ratio;
Declaration
public AspectRatio AspectRatio { get; set; }
Property Value
Type | Description |
---|---|
AspectRatio | The AspectRatio,By default None |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set AspectRatio
ieSettings.AspectRatio = AspectRatio.None;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set AspectRatio
ieSettings.AspectRatio = AspectRatio.None
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
AutoDetectPageBreak
Gets or Sets a value indicating whether to auto-detect page-break in the webpage;
Declaration
public bool AutoDetectPageBreak { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if Page break is enabled, otherwise, |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable auto detect page break.
ieSettings.AutoDetectPageBreak = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable auto detect page break.
ieSettings.AutoDetectPageBreak = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
ClearInternetCache
Gets or sets a value indicating whether to clear Internet cache;
Declaration
public bool ClearInternetCache { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the internetcache clears , otherwise false. |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set clear internet cache.
ieSettings.ClearInternetCache = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set clear internet cache.
ieSettings.ClearInternetCache = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
DisableIEWarning
Sets a value that indicates whether to remove the IE engine warning or not. The default value is false.
Declaration
public bool DisableIEWarning { set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Disable IE warning message
ieSettings.DisableIEWarning = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Disable IE warning message
ieSettings.DisableIEWarning = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
EnableActiveXControl
Gets or Sets a value indicating whether to Enable/Disable ActiveX contents in the webpage;
Declaration
public bool EnableActiveXControl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if ActiveXControl enabled, otherwise false. Default is false |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable ActiveX controls in the webpage.
ieSettings.EnableActiveXControl = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable ActiveX controls in the webpage.
ieSettings.EnableActiveXControl = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
EnableBinaryBehaviors
Gets or Sets a value indicating whether to Enable/Disable binary behaviors in the webpage;
Declaration
public bool EnableBinaryBehaviors { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable binary behaviors in webpages.
ieSettings.EnableBinaryBehaviors = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable binary behaviors in webpages.
ieSettings.EnableBinaryBehaviors = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
EnableForm
Gets or sets enable form; If it is enabled then HTML form fields are converted to PDF form fields in the generated PDF document. The default value is false.
Declaration
public bool EnableForm { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable HTML form to PDF form conversion
ieSettings.EnableForm = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable HTML form to PDF form conversion
ieSettings.EnableForm = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
EnableHyperLink
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not.
Declaration
public bool EnableHyperLink { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the Hyperlinks are enabled, otherwise false.Default is true |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable hyperlink
ieSettings.EnableHyperLink = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable hyperlink
ieSettings.EnableHyperLink = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
EnableJavaScript
Gets or Sets a value indicating whether to Enable/Disable JavaScripts in the webpage.
Declaration
public bool EnableJavaScript { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if Javascript is enabled, otherwise,false. default is true |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable javascript
ieSettings.EnableJavaScript = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable javascript
ieSettings.EnableJavaScript = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
HtmlEncoding
Declaration
public Encoding HtmlEncoding { get; set; }
Property Value
Type | Description |
---|---|
System.Text.Encoding |
IsPDFA1B
Gets or sets a value indicating the output PDF is A1B;
Declaration
public bool IsPDFA1B { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set PDF A1B conversion
ieSettings.IsPDFA1B = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set PDF A1B conversion
ieSettings.IsPDFA1B = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
IsTaggedPDF
Gets or sets a value indicating the output PDF is tagged;
Declaration
public bool IsTaggedPDF { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Enable tagged PDF conversion
ieSettings.IsTaggedPDF = true;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Enable tagged PDF conversion
ieSettings.IsTaggedPDF = True
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Margin
Gets or sets the margins of the page.
Declaration
public PdfMargins Margin { get; set; }
Property Value
Type | Description |
---|---|
PdfMargins | The PdfMargins, provides margins to the PDF page. By default , PDF margin is 0. |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set margins
ieSettings.Margin.All = 20;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set margins
ieSettings.Margin.All = 20
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
Orientation
Gets or sets the Orientation of the PDF document;
Declaration
public PdfPageOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
PdfPageOrientation | The PdfPageOrientation, provides the orientation of the PDF page. By default Portrait |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set PDF page orientation
ieSettings.Orientation = PdfPageOrientation.Landscape;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set PDF page orientation
ieSettings.Orientation = PdfPageOrientation.Landscape
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
PageRotateAngle
Gets or sets the number of degrees by which the page should be rotated clockwise when displayed or printed.
Declaration
public PdfPageRotateAngle PageRotateAngle { get; set; }
Property Value
Type | Description |
---|---|
PdfPageRotateAngle | The PdfPageRotateAngle,provides number of degrees by which the page should be rotated clockwise when displayed or printed |
Remarks
Default value: RotateAngle0
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set PDF page rotation angle
ieSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set PDF page rotation angle
ieSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
Password
Gets or Sets the password;
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String | String value representing the password of the HTML document. By default "" |
Remarks
To know more details about windows authentication, refer this link.
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set username and password for converting windows authenticated webpage to PDF
ieSettings.Username = "username";
ieSettings.Password = "password";
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set username and password for converting windows authenticated webpage to PDF
ieSettings.Username = "username"
ieSettings.Password = "password"
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
PdfFooter
Gets or sets the Footer to the PDF document;
Declaration
public PdfPageTemplateElement PdfFooter { get; set; }
Property Value
Type | Description |
---|---|
PdfPageTemplateElement | The PdfPageTemplateElement to draw into the PDF page. By default null |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Create PDF page template element for footer with bounds.
PdfPageTemplateElement footer = new PdfPageTemplateElement(new RectangleF(0, 0, ieSettings.PdfPageSize.Width, 50));
//Create font and brush for footer element.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 7);
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Draw the footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty);
//Assign the footer element to PdfHeader of IE settings.
ieSettings.PdfFooter = footer;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Create PDF page template element for footer with bounds.
Dim footer As New PdfPageTemplateElement(New RectangleF(0, 0, ieSettings.PdfPageSize.Width, 50))
'Create font and brush for footer element.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 7)
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw the footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty)
'Assign the footer element to PdfHeader of IE settings.
ieSettings.PdfFooter = footer
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
PdfHeader
Gets or sets the Header to the PDF document;
Declaration
public PdfPageTemplateElement PdfHeader { get; set; }
Property Value
Type | Description |
---|---|
PdfPageTemplateElement | The PdfPageTemplateElement to draw into the PDF page. By default null |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Create PDF page template element for header with bounds.
PdfPageTemplateElement header = new PdfPageTemplateElement(new RectangleF(0, 0, ieSettings.PdfPageSize.Width, 50));
//Create font and brush for header element.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 7);
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Draw the header string in header template element.
header.Graphics.DrawString("This is header", font, brush, PointF.Empty);
//Assign the header element to PdfHeader of IE settings.
ieSettings.PdfHeader = header;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Create PDF page template element for header with bounds.
Dim header As New PdfPageTemplateElement(New RectangleF(0, 0, ieSettings.PdfPageSize.Width, 50))
'Create font and brush for header element.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 7)
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw the header string in header template element.
header.Graphics.DrawString("This is header", font, brush, PointF.Empty)
'Assign the header element to PdfHeader of IE settings.
ieSettings.PdfHeader = header
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
PdfPageSize
Gets or sets the size of the PDF page;
Declaration
public SizeF PdfPageSize { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
Remarks
Default value: 595 * 842 pixels(A4 size)
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set PDF page size
ieSettings.PdfPageSize = new SizeF(595, 842);
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set PDF page size
ieSettings.PdfPageSize = New SizeF(595, 842)
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
See Also
SplitImages
Gets or sets a value indicating whether [split images].
Declaration
public bool SplitImages { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set SplitImages to avoid image split between pages.
ieSettings.SplitImages = false;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set SplitImages to avoid image split between pages.
ieSettings.SplitImages = False
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
SplitTextLines
Gets or sets a value indicating whether [split text lines].
Declaration
public bool SplitTextLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set SplitTextLines to avoid text split between pages.
ieSettings.SplitTextLines = false;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set SplitTextLines to avoid text split between pages.
ieSettings.SplitTextLines = False
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
TempPath
Gets or sets the temp path where the temporary operations are performed if any.
Declaration
public string TempPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | Temp path which contains internal conversion files.By default %temp% |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set temp path for the conversion.
ieSettings.TempPath = Path.GetTempPath();
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set temp path for the conversion, this path will be used for saving the temporary files.
ieSettings.TempPath = Path.GetTempPath()
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Timeout
Set the maximum time in milliseconds to wait for HTML page to be loaded;
Declaration
public int Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Specifies the timeout to the HTML converter.Unit is Milliseconds; By default 0 |
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set timeout for the conversion.
ieSettings.Timeout = 3000;
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set timeout for the conversion.
ieSettings.Timeout = 3000
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Username
Gets or Sets the Username;
Declaration
public string Username { get; set; }
Property Value
Type | Description |
---|---|
System.String | String value representing the user name of the HTML document. By default "" |
Remarks
To know more details about windows authentication, refer this link.
Examples
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
//Initialize the IE converter settings
IEConverterSettings ieSettings = new IEConverterSettings();
//Set username and password for converting windows authenticated webpage to PDF
ieSettings.Username = "username";
ieSettings.Password = "password";
//Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
'Initialize the IE converter settings
Dim ieSettings As New IEConverterSettings()
'Set username and password for converting windows authenticated webpage to PDF
ieSettings.Username = "username"
ieSettings.Password = "password"
'Assign IE settings to HTML converter
htmlConverter.ConverterSettings = ieSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()