Syncfusion.HtmlConverter.Base
Gets or sets the value is indicating EnableForm is enable or not
Gets or sets the value is indicating EnableBookmarks is enable or not
Gets or sets the HtmlElementID
Gets or sets the PdfLayoutResult value
Gets or sets the value is indicating PdfLayoutResult is enable or not
Gets or sets the Blink command line arguments.
Gets or sets the value is indicating EnableToc is enable or not
Gets or sets TOC styles
/// This property is used internally and should not be used directly.
Delete the file
Type of proxy server
///
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
No proxy
Http proxy type
Socks5 proxy type
Returns An Array of all active targets
Returns a Task which resolves to an array of all open pages.
The method launches a browser instance with given arguments.
Attaches converter to an existing Chromium instance.
Gets that target this page was created from.
The method runs QuerySelector within the page. If no element matches the selector, the return value resolve to null.
Runs QuerySelectorAll within the page. If no elements match the selector.
Executes a script in browser context
Executes a script in browser context
Set offline mode for the page.
Takes a screenshot of the page
Takes a screenshot of the page
Takes a screenshot of the page
Takes a screenshot of the page
Returns page's title
Fetches an element with selector and scrolls it into view if needed, and then uses mouse to hover over the center of the element.
Fetches an element with selector and focuses it
Waits for a timeout
Waits for a script to be evaluated
Waits for a script to be evaluated
Waits for a selector to be added to the DOM
Waits for navigation
Whether to ignore HTTPS errors during navigation.
Gets or sets App mode for the conversion.
Options for launching the Chromium browser.
The x coordinate of the element in pixels.
The y coordinate of the element in pixels.
The width of the element in pixels.
The height of the element in pixels.
x-coordinate of top-left corner of clip area.
y-coordinate of top-left corner of clip area.
Width of clipping area.
Height of clipping area.
Scale of the webpage rendering. Defaults to 1.
Specifies clipping region of the page.
When true, takes a screenshot of the full scrollable page. Defaults value is false
Hides default white background and allows capturing screenshots with transparency. Defaults value is false.
Specify screenshot type, can be either jpeg or png. Defaults to 'png'.
The quality of the image, between 0-100. Not applicable to png images.
Gets or sets the width
Gets or sets the height.
Gets or sets whether the meta viewport tag is taken into account.
Gets or sets the device scale factor.
Gets or sets if viewport is in landscape mode.
Gets or sets if viewport supports touch events.
Optional waiting parameters.
Maximum time to wait for in milliseconds. Defaults to 30000 (30 seconds).
To constantly execute pageFunction in requestAnimationFrame callback.
This is the tightest polling mode which is suitable to observe styling changes.
To execute pageFunction on every DOM mutation.
Optional waiting parameters.
Maximum time to wait for in milliseconds. Defaults to 30000 (30 seconds).
Wait for selector to become visible.
Wait for selector to become hidden.
Consider navigation to be finished when the load event is fired
Consider navigation to be finished when the DOMContentLoaded event is fired
Consider navigation to be finished when there are no more than 0 network connections for at least 500 ms
Consider navigation to be finished when there are no more than 2 network connections for at least 500 ms
Creates a new page, if the target is not page returns null
Creates a Chrome Devtools Protocol session attached to the target.
Starts tracing.
Gets or sets a value indicating whether Tracing should captures screenshots in the trace
A path to write the trace file to
Specify custom categories to use instead of default.
gathers information about parts of JavaScript and CSS that were used by the page.
Starts JS coverage
Stops JS coverage and returns coverage reports for all non-anonymous scripts
Fetches a single property from the referenced object
Returns a dictionary with property names as keys and JSHandle instances for the property values.
Returns a JSON representation of the object
Returns a JSON representation of the object
Set of configurable options for coverage
Whether to reset coverage on every navigation.
This method scrolls element into view if needed, and then uses ScreenshotAsync to take a screenshot of the element.
This method scrolls element into view if needed, and then uses ScreenshotStreamAsync to take a screenshot of the element.
This method scrolls element into view if needed, and then uses ScreenshotAsync to take a screenshot of the element.
This method scrolls element into view if needed, and then uses ScreenshotAsync to take a screenshot of the element.
Evaluates the XPath expression relative to the elementHandle. If there's no such element, the method will resolve to null.
This method returns the bounding box of the element
Executes a script in browser context
Executes a script in browser context
Executes a function in browser context
Executes a function in browser context
Executes a script in browser context
Executes a script in browser context
Executes a function in browser context
Executes a function in browser context
Gets the associated with the frame.
Queries frame for the selector. If there's no such element within the frame, the method will resolve to null.
Waits for a selector to be added to the DOM
Starts listening the socket
Options for connecting to an existing browser.
Whether to ignore HTTPS errors during navigation. Defaults to false.
If set to true, sets Headless = false, otherwise, enables automation.
A browser websocket endpoint to connect to.
Slows down converter operations by the specified amount of milliseconds. Useful so that you can see what is going on.
Keep alive value.
Detaches session from target. Once detached, session won't emit any events and can't be used to send messages.
Continues request with optional request overrides. To use this, request interception should be enabled with . Exception is immediately thrown if the request interception is not enabled.
Abort error codes. RequestAbortErrorCode
An operation was aborted (due to user action)
Permission to access a resource, other than the network, was denied
The IP address is unreachable. This usually means that there is no route to the specified host or network.
A connection timed out as a result of not receiving an ACK for data sent.
A connection was closed (corresponding to a TCP FIN).
A connection attempt failed.
A connection attempt was refused.
A connection was reset (corresponding to a TCP RST).
The Internet connection has been lost.
The host name could not be resolved.
An operation timed out.
A generic failure occurred.
Contains the URL of the response.
Returns a Task which resolves to a buffer with response body
Navigation options used by WaitForNavigationAsync
Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.
When to consider navigation succeeded, defaults to WaitUntilNavigation.Load.
Class which allows converting Html to the Image.
Loading flags
Internal variable to store webbrowser scroll position.
Internal variable to store current regions.
Internal variable to store size of the web page.
Internal variable to store if the specified size should be used. Must be true for Tagged PDF.
While enabling this property the text and images will be split across pages even if SplitTextLines and SplitImages were set to false.
Gets or Sets the Username
String value representing the user name of the HTML document.
Gets or Sets the password
String value representing the password of the HTML document.
Gets or Sets a value indicating whether to Enable/Disable Javascripts in the webpage.
True if Javascript is enabled, otherwise,false. default is true
Gets or Sets a value indicating whether to Enable/Disable Javascript in the web page.
True if ActiveXContents enabled, otherwise false. Default is false
Gets or Sets a value indicating whether to Enable/Disable binary behaviors in the webpage.
true if [BinaryBehaviors enabled]; otherwise, false. Default is false
Gets or Sets a value indicating whether to auto-detect page-break in the webpage.
True if Page break is enabled, otherwise, false. Default is true
Set the maximum time in milliseconds to wait for HTML page to be loaded;
Specifies the timeout to the HTML converter.Unit is Milliseconds; By default 0
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not.
True if the Hyperlinks are enabled, otherwise false.Default is true
Gets or Sets a value to delay the script loading.
A integer value indicating to apply delay for loading scripts.Unit is Milliseconds; By default 0
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.
Gets or sets a value indicating whether to clear Internet cache.
True if the internetcache clears , otherwise false.
Gets or sets the scroll position.
Gets or sets if specified size should be used. Must be true for Tagged PDF.
Gets or sets Encoding for HTML string to PDF conversion.
This property will not have any effect on URL to PDF conversion
Gets or sets the repetition of table header. By enabling this property, will repeat the table header on every page break. The default value is false.
Gets or sets the repetition of table footer. By enabling this property, will repeat the table footer on every page break. The default value is false.
A property indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not. By default the automatic bookmarks creation is disabled
A property indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not. By default this property is false
Gets or sets Toc styles
Gets or sets cookie collection with names and values
The cookies Collection
Class
Gets or sets a background color when converting a HTML document.
Offset to the width/height.
Timeout of the thread while document is lodaing.
Blank page.
IDispatch:: Invoke params.
Metafile Execute parameters.
Bitmap Execute parameters.
Indicates whether loading of the document is completed.
Url to the Html resource.
Type of the image.
Indicates whether we should stop navigation.
String containing html data.
Original size of the image.
The aspect ratio of the image.
Checks whether link wrapped
Initializes a new instance of the class.
Disposes component.
Indicates whether dispose managed resources or not.
Initializes a new instance of the class with specified HTML renderer.
Specifies the HTML renderer.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
Aspect ratio of the image.
Image, containing data from the HTML.
Image height can be greater than value.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
Aspect ratio of the image.
The User name.
The Password.
Image, containing data from the HTML.
Image height can be greater than value.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
Image, containing data from the HTML.
Image height can be greater than value.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
The User name.
The Password.
Image, containing data from the HTML.
Image height can be greater than value.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
Image, containing data from the HTML.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Preferred width of the image in pixels.
The User name.
The Password.
Image, containing data from the HTML.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
Image, containing data from the HTML.
Calculates the offsets.
The size.
Gets the images from URL.
The URL.
The type.
Converts HTML by the URL to the image.
Path to the HTML resource.
Type of the output image.
The User name.
The Password.
Image, containing data from the HTML.
Converts HTML data contained in the stream to the image.
Stream containing HTML data.
Encoding used for reading data from the stream.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
Aspect ratio of the image.
Image, containing data from the HTML.
If the stream can seek, the position will be set to 0 before data reading.
Converts HTML data contained in the stream to the image.
Stream containing HTML data.
Encoding used for reading data from the stream.
Type of the output image.
Preferred width of the image in pixels.
Preferred height of the image in pixels.
Image, containing data from the HTML.
If the stream can seek, the position will be set to 0 before data reading.
Converts HTML data contained in the stream to the image.
Stream containing HTML data.
Encoding used for reading data from the stream.
Type of the output image.
Preferred width of the image in pixels.
Image, containing data from the HTML.
If the stream can seek, the position will be set to 0 before data reading.
Converts Html data contained in the stream to the image.
Stream containing HTML data.
Encoding used for reading data from the stream.
Type of the output image.
Image, containing data from the HTML.
If the stream can seek, the position will be set to 0 before data reading.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Used to retrieve images, scripts and stylesheets.
Preferred width of the image.
Preferred height of the image.
Aspect ratio of the image.
The User name.
The Password.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Used to retrieve images, scripts and stylesheets.
Preferred width of the image.
Preferred height of the image.
Aspect ratio of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Used to retrieve images, scripts and stylesheets.
Type of the image.
Preferred width of the image.
Preferred height of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Used to retrieve images, scripts and stylesheets.
Type of the image.
Preferred width of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Used to retrieve images, scripts and stylesheets.
Type of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Used to retrieve images, scripts and stylesheets.
Type of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Preferred width of the image.
Preferred height of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Preferred width of the image.
Preferred height of the image.
Aspect ratio of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Preferred width of the image.
Image, containing data from the HTML.
Renders HTML from the string to the image.
HTML data.
Type of the image.
Image, containing data from the HTML.
The Password.
The layout result of the PDF document
Converts the URL as Tagged PDF.
The PDF document
Path to the HTML resource.
The layout result of the PDF document
Converts the HTML string as Tagged PDF.
The PDF document
Path to the HTML resource.
Used to retrieve images, scripts and stylesheets.
The layout result of the PDF document
Converts html to image.
Converted image.
Converts HTML to HtmlToPdfElement result.
HTML data.
Used to retrieve images, scripts and stylesheets.
Specifies the image type
Integer value specifying the width of the web browser
Integer value specifying the height of the web browser
Representing dimension of the image.
The user name
The password
Converted image.
Converts HTML to HtmlToPdfElement result.
HTML data.
Used to retrieve images, scripts and stylesheets.
Specifies the image type
Integer value specifying the width of the web browser
Integer value specifying the height of the web browser
Representing dimension of the image.
Converted image.
Converts the given HTML string to HtmlToPdfResult.
HTML data.
Used to retrieve images, scripts and stylesheets.
Specifies the image type
Integer value specifying the width of the web browser
Integer value specifying the height of the web browser
Representing dimension of the image.
Converted image.
find color for background rectangle of each form elements of pdf document.
Founded color.
Converts html to HtmlToPdf Element result.
Converted image.
Converts Html to metafile.
Metafile image.
Converts Html to metafile.
Metafile image.
Converts Html to bitmap.
Bitmap image.
Converts Html to bitmap.
Bitmap image.
Start exporting Html to Image.
Returns BODY element of the document.
BODY element of the document.
Returns the current document.
The current document.
Resizes browser to the document.
Resizes browser to the document.
Size of the browser.
Resizes browser to the document.
Size of the browser.
Prints Html to the device context.
Device context.
Saves metafile to the file. It's debug method.
data containing metafile.
disables scrollbars.
Sets width of the web browser.
Width of the web browser.
Sets height of the web browser.
Height of the web browser.
Resets the settings.
Calculates size of the resulting image.
Size of the document.
Size of the image.
Calculates the bounds of the Html Element.
The Html Element.
The Bounds.
Gets page break.
Returns all document links present in the HTML.
Gets page break.
Loading of the document completed.
Sender of the event.
Event arguments.
Blocks popups.
Sender of the event.
Event arguments.
Handles Navigation Error.
Sender of the event.
Event arguments.
Register this window as host of the web browser.
Applies download and executing properties.
Settings flag.
Don't call this method. It's used for internal purpose only.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Customization method.
Class to execute javascript calls for GetExternal.
Requires a handle to the owning form
Specifies the image type
Image is bitmap.
Image is metafile.
Specifies the primary dimension of the output image.
//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()
Don't apply keeping of aspect ratio.
Keep width fixed and proportionally change height of the image.
Keep height fixed and proportionally change width of the image.
keep the width and height.
Class which allows converting HTML to PDF.
To know more details about HTML to PDF conversion refer this
link.
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Indicates default DPI for PdfUnitConvertor.
Gets or sets the rendering engine used for conversion.
Specifies rendering engine (Default IE rendering engine).
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
//Set rendering engine for conversion
htmlConverter.RenderingEngine = HtmlRenderingEngine.WebKit;
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKitPath
settings.WebKitPath = "/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter()
'Set rendering engine for conversion
htmlConverter.RenderingEngine = HtmlRenderingEngine.WebKit
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKitPath
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
class
Gets or sets rendering engine settings.
Specifies rendering engine settings.
To know more details about converter settings, refer this
link.
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
class
Initializes a new instance of the class.
To know more details about IE rendering engine, refer this
link.
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
//Initialize the IE converter settings
IEConverterSettings settings = new IEConverterSettings();
//Assign IE settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter()
'Initialize the IE converter settings
Dim settings As New IEConverterSettings()
'Assign IE settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Initializes a new instance of the class with specified .
Rendering Engine used for conversion
To know more details about HTML to PDF converter, refer this
link.
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the HTML resource.
The PDF document
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
class
class
Converts URL to PDF document
To know more details about pdf layout result refer this
link.
Path to the Html resource.
Layout result
PDF document
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKitPath
settings.WebKitPath = "/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Initialize PDF layout result
PdfLayoutResult pdfLayoutResult = null;
//Convert URL to PDF and get PDF layout result
PdfDocument document = htmlConverter.Convert("https://www.google.com", out pdfLayoutResult);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKitPath
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Initialize PDF layout result
Dim pdfLayoutResult As PdfLayoutResult = Nothing
'Convert URL to PDF and get PDF layout result
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com", pdfLayoutResult)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
class
Converts URL to PDF document
Path to the Html resource.
Preferred width of the PDF page.
Preferred height of the PDF page.
Aspect ratio of the PDF.
PDF document
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKitPath
settings.WebKitPath = "/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKitPath
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the Html resource.
Preferred width of the PDF page.
Preferred height of the PDF page.
Aspect ratio
Layout result
PDF document
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKitPath
settings.WebKitPath = "/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Initialize PDF layout result
PdfLayoutResult pdfLayoutResult = null;
//Convert URL to PDF and get PDF layout result
PdfDocument document = htmlConverter.Convert("https://www.google.com", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None, out pdfLayoutResult);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKitPath
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Initialize PDF layout result
Dim pdfLayoutResult As PdfLayoutResult = Nothing
'Convert URL to PDF and get PDF layout result
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None, pdfLayoutResult)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the HTML resource.
Used to convert particular part of a HTML page to PDF
The PDF document
To know more details about partial HTML to PDF conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert Partial webpage to PDF using HTML element ID, here pic is an HTML element ID.
PdfDocument document = htmlConverter.ConvertPartialHtml("input.html", "pic");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert Partial webpage to PDF using HTML element ID, here pic is an HTML element ID.
Dim document As PdfDocument = htmlConverter.ConvertPartialHtml("input.html", "pic")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the HTML resource.
Used to convert particular part of a HTML page to PDF
Layout result
The PDF document
To know more details about partial HTML to PDF conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Initialize PDF layout result
PdfLayoutResult pdfLayoutResult = null;
//Convert partial HTML to PDF and get PDF layout result
PdfDocument document = htmlConverter.ConvertPartialHtml("input.html", "pic", out pdfLayoutResult);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Initialize PDF layout result
Dim pdfLayoutResult As PdfLayoutResult = Nothing
'Convert partial HTML to PDF and get PDF layout result
Dim document As PdfDocument = htmlConverter.ConvertPartialHtml("input.html", "pic", pdfLayoutResult)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the Html resource.
Used to convert particular part of a HTML page to PDF
Preferred width of the PDF page.
Preferred height of the PDF page.
Aspect ratio of the PDF.
PDF document
To know more details about partial HTML to PDF conversion, refer this
link.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.ConvertPartialHtml("input.html", "pic", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.ConvertPartialHtml("input.html", "pic", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Converts URL to PDF document
Path to the Html resource.
Used to convert particular part of a HTML page to PDF
Preferred width of the PDF page.
Preferred height of the PDF page.
Aspect ratio of the PDF.
Layout result
PDF document
To know more details about partial HTML to PDF conversion, refer this
link.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Initialize PDF layout result
PdfLayoutResult pdfLayoutResult = null;
//Convert URL to PDF and get PDF layout result
PdfDocument document = htmlConverter.ConvertPartialHtml("input.html", "pic", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None, out pdfLayoutResult);
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Initialize PDF layout result
Dim pdfLayoutResult As PdfLayoutResult = Nothing
'Convert URL to PDF and get PDF layout result
Dim document As PdfDocument = htmlConverter.ConvertPartialHtml("input.html", "pic", PdfPageSize.A4.Width, PdfPageSize.A4.Height, AspectRatio.None, pdfLayoutResult)
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
class
Converts an URL or local file to MHTML and writes the converted MHTML into a file.
The URL or local file path of the HTML document to convert to MHTML.
The path of the converted MHTML file.
To know more details about HTML to MHTML conversion, refer this
link.
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to MHTML
htmlConverter.ConvertToMhtml("http://www.syncfusion.com", "sample.mhtml");
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to MHTML
htmlConverter.ConvertToMhtml("http://www.syncfusion.com", "sample.mhtml")
class
Converts an URL or local file to MHTML and writes the converted MHTML into a stream.
The URL or local file path of the HTML document to convert to MHTML.
The stream of the converted MHTML file.
To know more details about HTML to MHTML conversion, refer this
link.
Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
MemoryStream stream = new MemoryStream();
//Convert URL to MHTML
htmlConverter.ConvertToMhtml("http://www.syncfusion.com", stream);
using (FileStream output = new FileStream("MyOutput.mhtml", FileMode.Create))
{
stream.CopyTo(output);
}
stream.Dispose();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
Dim stream As New MemoryStream()
'Convert URL to MHTML
htmlConverter.ConvertToMhtml("http://www.syncfusion.com", stream)
File.WriteAllBytes("Sample.mhtml", stream.ToArray())
stream.Dispose()
class
Converts an URL or local file to SVG and writes the converted SVG into a file.
The URL or local file path of the HTML document to convert to SVG.
The path of the converted SVG file
To know more details about HTML to SVG conversion, refer this
link.
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to SVG
htmlConverter.ConvertToSvg("http://www.syncfusion.com", "sample.svg");
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to SVG
htmlConverter.ConvertToSvg("http://www.syncfusion.com", "sample.svg")
class
Converts an URL or local file to SVG and writes the converted SVG into a stream.
The URL or local file path of the HTML document to convert to SVG.
The stream of the converted SVG file.
To know more details about HTML to Partial SVG conversion, refer this
link.
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
Stream stream = new MemoryStream();
//Convert URL to SVG
htmlConverter.ConvertToSvg(url, stream);
using (System.IO.FileStream output = new System.IO.FileStream(@"C:\MyOutput.svg", FileMode.Create))
{
stream.CopyTo(output);
}
stream.Dispose();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
Dim stream As New MemoryStream()
'Convert URL to SVG
htmlConverter.ConvertToSvg("http://www.syncfusion.com", stream)
File.WriteAllBytes("Sample.svg", stream.ToArray())
stream.Dispose()
class
Converts an URL or local file to SVG and writes the converted SVG into a file.
The URL or local file path of the HTML document to convert to SVG.
Used to convert particular part of a HTML page to SVG
The path of the converted SVG file
To know more details about HTML to Partial SVG conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert Partial HTML to SVG
htmlConverter.ConvertPartialHtmlToSvg("input.html", "pic", "Output.svg");
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert Partial HTML to SVG
htmlConverter.ConvertPartialHtmlToSvg("input.html", "pic", "Output.svg")
class
Converts an URL or local file to SVG and writes the converted SVG into a stream.
The URL or local file path of the HTML document to convert to SVG.
Used to convert particular part of a HTML page to SVG
The stream of the converted SVG file.
To know more details about HTML to Partial SVG conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
Stream stream = new MemoryStream();
//Convert Partial HTML to SVG
htmlConverter.ConvertPartialHtmlToSvg("input.html", "pic", stream);
using (System.IO.FileStream output = new System.IO.FileStream(@"C:\MyOutput.svg", FileMode.Create))
{
stream.CopyTo(output);
}
stream.Dispose();
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
Dim stream As New MemoryStream()
'Convert Partial HTML to SVG
htmlConverter.ConvertPartialHtmlToSvg("input.html", "pic", stream)
File.WriteAllBytes("Sample.svg", stream.ToArray())
stream.Dispose()
class
Converts URL to Image
Path to the Html resource.
Image Array
To know more details about HTML to Image conversion, refer this
link.
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converte
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to Image
Image[] image = htmlConverter.ConvertToImage("http://www.syncfusion.com");
//Save the image.
image[0].Save("Sample.jpg");
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to Image
Dim image As Image() = htmlConverter.ConvertToImage("http://www.syncfusion.com ")
'Save the image
image(0).Save("Sample.jpg")
class
class
class
class
Converts HTML string to Image
Html data.
Used to retrieve images, scripts and stylesheets.
Image Array
To know more details about HTML string to Image conversion, refer this
link.
string htmlString = "Hello World!!!";
string baseURL = "";
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML string to Image
Image[] image = htmlConverter.ConvertToImage(htmlString, baseURL);
//Save the image.
image[0].Save("Sample.jpg");
Dim htmlString As String = "Hello World!!!
Dim baseURL As String = ""
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML string to Image
Dim image As Image() = htmlConverter.ConvertToImage(htmlString, baseURL)
'Save the image.
image(0).Save("Sample.jpg")
class
class
class
class
Converts URL to Image
Path to the Html resource.
Used to convert particular part of a HTML page to image
Image Array
To know more details about partial HTML to Image conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert Partial HTML to Image
Image[] image = htmlConverter.ConvertPartialHtmlToImage("input.html", "pic");
//Save Image
image[0].Save("Output.jpg");
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert Partial HTML to Image
Dim image As Image() = htmlConverter.ConvertPartialHtmlToImage("input.html", "pic")
'Save Image
image(0).Save("Output.jpg")
class
class
Updating Blink converter settings
Interface for Rendering engine settings
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the temp path where the temporary operations are performed if any;By default %temp%
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set temporary path for conversion
converterSettings.TempPath = @"C:/HtmlConversion/Temp/";
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set temporary path for conversion
converterSettings.TempPath = "C:/HtmlConversion/Temp/"
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the additional delay to load JavaScript; Unit is Milliseconds; By default 0
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set AdditionalDelay for conversion
converterSettings.AdditionalDelay = 2000;
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set AdditionalDelay for conversion
converterSettings.AdditionalDelay = 2000
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not;By default true
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set EnableHyperLink
converterSettings.EnableHyperLink = true;
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set EnableHyperLink
converterSettings.EnableHyperLink = True
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets a value indicating whether to Enable/Disable JavaScripts in the webpage; By default true
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set EnableJavaScript
converterSettings.EnableJavaScript = true;
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set EnableJavaScript
converterSettings.EnableJavaScript = True
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets the password; By default ""
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set username and password for windows authentication
converterSettings.Username = "username";
converterSettings.Password = "password";
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set username and password for windows authentication
converterSettings.Username = "username"
converterSettings.Password = "password"
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets the Username; By default ""
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set username and password for windows authentication
converterSettings.Username = "username";
converterSettings.Password = "password";
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set username and password for windows authentication
converterSettings.Username = "username"
converterSettings.Password = "password"
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the margins to the PDF document; By default all margins are 0
//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings.
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set margins
webKitSettings.Margin.All = 20;
//Assign WebKit settings to HTML converter.
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML string 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.WebKit)
'Initialize the WebKit converter settings.
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set margins
webKitSettings.Margin.All = 20
'Assign WebKit settings to HTML converter.
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML string to PDF.
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Header to the PDF document; By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Create PDF page template element for header with bounds.
PdfPageTemplateElement header = new PdfPageTemplateElement(new RectangleF(0, 0, webKitSettings.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 WebKit settings.
webKitSettings.PdfHeader = header;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Create PDF page template element for header with bounds.
Dim header As New PdfPageTemplateElement(New RectangleF(0, 0, webKitSettings.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 WebKit settings.
webKitSettings.PdfHeader = header
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Footer to the PDF document; By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Create PDF page template element for footer with bounds.
PdfPageTemplateElement footer = new PdfPageTemplateElement(new RectangleF(0, 0, webKitSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty);
//Assign the footer element to PdfFooter of WebKit settings.
webKitSettings.PdfFooter = footer;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Create PDF page template element for footer with bounds.
Dim footer As New PdfPageTemplateElement(New RectangleF(0, 0, webKitSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty)
'Assign the footer element to PdfFooter of WebKit settings.
webKitSettings.PdfFooter = footer
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Orientation of the PDF document; By default Portrait
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page orientation
webKitSettings.Orientation = PdfPageOrientation.Landscape;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page orientation
webKitSettings.Orientation = PdfPageOrientation.Landscape
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
enum
Gets or sets the size of the PDF page; By default A4 size
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page size
webKitSettings.PdfPageSize = new SizeF(595, 842);
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page size
webKitSettings.PdfPageSize = New SizeF(595, 842)
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the aspect ratio; By default None
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set AspectRatio
webKitSettings.AspectRatio = AspectRatio.None;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set AspectRatio
webKitSettings.AspectRatio = AspectRatio.None
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the number of degrees by which the page should be rotated clockwise when displayed or printed.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page rotation angle
webKitSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page rotation angle
webKitSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets a value indicating whether [split text lines].
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set split text lines to false to avoid text split between PDF pages.
converterSettings.SplitTextLines = false;
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set split text lines to false to avoid text split between PDF pages.
converterSettings.SplitTextLines = False
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets a value indicating whether [split images].
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the converter settings
IHtmlConverterSettings converterSettings = new WebKitConverterSettings();
//Set WebKitPath
(converterSettings as WebKitConverterSettings).WebKitPath = @"/QtBinaries/";
//Set split images to false to avoid image split between PDF pages.
converterSettings.SplitImages = false;
//Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("http://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the converter settings
Dim converterSettings As IHtmlConverterSettings = New WebKitConverterSettings()
'Set WebKitPath
TryCast(converterSettings, WebKitConverterSettings).WebKitPath = "/QtBinaries/"
'Set split images to false to avoid image split between PDF pages.
converterSettings.SplitImages = False
'Assign converter settings to HTML converter
htmlConverter.ConverterSettings = converterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Class which represents collection of cookies name and value pair of data.
To know more details about cookies, refer this
link.
Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Initialize cookie collection and add the cookies name and value.
CookieCollection cookieCollection = new CookieCollection();
cookieCollection.Add("CookieName1", "CookieValue1");
cookieCollection.Add("CookieName2", "CookieValue2");
//Assign the cookie collection to the webkit settings.
webKitSettings.Cookies = cookieCollection;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Initialize cookie collection and add the cookies name and value.
Dim cookieCollection As New CookieCollection()
cookieCollection.Add("CookieName1", "CookieValue1")
cookieCollection.Add("CookieName2", "CookieValue2")
'Assign the cookie collection to the webkit settings.
webKitSettings.Cookies = cookieCollection
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Represents a collection of the HTTP POST parameters.
To know more details about HTTP Get and POST, refer this
link.
Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Initialize HTTP Post collection and add the name and value to POST.
HttpPostFieldCollection httpPostCollection = new HttpPostFieldCollection();
httpPostCollection.Add("firstName", "Andrew");
httpPostCollection.Add("lastName", "Fuller");
//Assign the HTTP Post field collection to the webkit settings.
webKitSettings.HttpPostFields = httpPostCollection;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Initialize HTTP Post collection and add the name and value to POST.
Dim httpPostCollection As New HttpPostFieldCollection()
httpPostCollection.Add("firstName", "Andrew")
httpPostCollection.Add("lastName", "Fuller")
'Assign the HTTP Post field collection to the webkit settings.
webKitSettings.HttpPostFields = httpPostCollection
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Represents a collection of the HTTP request headers
To know more details about HTTP request headers, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Initialize HTTP header collection and add the name and value.
HttpRequestHeaderCollection httpRequestHeaderCollection = new HttpRequestHeaderCollection();
httpRequestHeaderCollection.Add("headername", "headervalue");
//Assign the HTTP header collection to the webkit settings.
webKitSettings.HttpRequestHeaders = httpRequestHeaderCollection;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Initialize HTTP header collection and add the name and value.
Dim httpRequestHeaderCollection As New HttpRequestHeaderCollection()
httpRequestHeaderCollection.Add("headername", "headervalue")
'Assign the HTTP header collection to the webkit settings.
webKitSettings.HttpRequestHeaders = httpRequestHeaderCollection
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Represents a collection of Blink command line arguments.
Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Initialize the Command Line Arguments
BlinkCommandLineArguments commandLineArguments = new BlinkCommandLineArguments();
commandLineArguments.Add("--no-proxy-server");
BlinkSettings.CommandLineArguments = commandLineArguments;
//Assign the Blink settings
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Initialize the Command Line Arguments
Dim commandLineArguments As New BlinkCommandLineArguments();
commandLineArguments.Add("--no-proxy-server")
BlinkSettings.CommandLineArguments = commandLineArguments;
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
Class which represents the proxy settings of WebKit HTML converter.
To know more details about proxy settings, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Initialize WebKit proxy settings and set the values
WebKitProxySettings proxySettings = new WebKitProxySettings();
proxySettings.UseSystemProxy = true;
//Assign the proxy settings to WebKit settings
webKitSettings.ProxySettings = proxySettings;
//Assign the WebKit settings to the converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Initialize WebKit proxy settings and set the values
Dim proxySettings As New WebKitProxySettings()
proxySettings.UseSystemProxy = True
'Assign the proxy settings to WebKit settings
webKitSettings.ProxySettings = proxySettings
'Assign the WebKit settings to the converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets use system proxy settings; If it is set to true WebKit converter use system proxy settings for conversion.
To know more details about using system proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Initialize WebKit proxy settings and set the values
WebKitProxySettings proxySettings = new WebKitProxySettings();
proxySettings.UseSystemProxy = true;
//Assign the proxy settings to WebKit settings
webKitSettings.ProxySettings = proxySettings;
//Assign the WebKit settings to the converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Initialize WebKit proxy settings and set the values
Dim proxySettings As New WebKitProxySettings()
proxySettings.UseSystemProxy = True
'Assign the proxy settings to WebKit settings
webKitSettings.ProxySettings = proxySettings
'Assign the WebKit settings to the converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets host name of proxy server
To know more details about using manual proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets port number of proxy server
To know more details about using manual proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets username of proxy server; optional;
To know more details about using manual proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username";
webKitSettings.ProxySettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username"
webKitSettings.ProxySettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets password of proxy server; optional;
To know more details about using manual proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username";
webKitSettings.ProxySettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username"
webKitSettings.ProxySettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets type of proxy server
To know more details about using manual proxy settings for conversion, refer this
link.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Initializes a new instance of the class.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http;
//Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username";
webKitSettings.ProxySettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http
'Set the username and password to authenticate the proxy server.
webKitSettings.ProxySettings.Username = "username"
webKitSettings.ProxySettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Represents the proxy settings of the Blink HTML converter.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Initialize Blink proxy settings and set the values
BlinkProxySettings proxySettings = new BlinkProxySettings();
proxySettings.Type = BlinkProxyType.http;
proxySettings.HostName = "127.0.0.1";
proxySettings.PortNumber = 8080;
//Assign the proxy settings to Blink settings
BlinkSettings.ProxySettings = proxySettings;
//Assign the Blink settings to the converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Initialize Blink proxy settings and set the values
Dim proxySettings As New BlinkProxySettings()
proxySettings.Type = BlinkProxyType.http
proxySettings.HostName = "127.0.0.1"
proxySettings.PortNumber = 8080
'Assign the proxy settings to Blink settings
BlinkSettings.ProxySettings = proxySettings
'Assign the Blink settings to the converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets host name of proxy server
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets port number of proxy server
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets type of proxy server
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the username of proxy server; optional.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
BlinkSettings.ProxySettings.Username = "user";
BlinkSettings.ProxySettings.Password = "pass";
//Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
BlinkSettings.ProxySettings.Username = "user"
BlinkSettings.ProxySettings.Password = "pass"
'Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the password of proxy server; optional.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
BlinkSettings.ProxySettings.Username = "user";
BlinkSettings.ProxySettings.Password = "pass";
//Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
BlinkSettings.ProxySettings.Username = "user"
BlinkSettings.ProxySettings.Password = "pass"
'Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Initializes a new instance of the class.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy with proxy server host and port number.
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Class which represents the settings of IE rendering engine
To know more details about IE rendering engine, refer this
link.
//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)
class
Gets or sets the temp path where the temporary operations are performed if any.
Temp path which contains internal conversion files.By default %temp%
//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()
Gets or sets the additional delay to load JavaScript;
Specifies the delay to load the scripts.Unit is Milliseconds; By default 0
//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()
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not.
True if the Hyperlinks are enabled, otherwise false.Default is true
//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()
Gets or Sets a value indicating whether to Enable/Disable JavaScripts in the webpage.
True if Javascript is enabled, otherwise,false. default is true
//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()
Gets or Sets the password;
String value representing the password of the HTML document. By default ""
To know more details about windows authentication, refer this
link.
//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()
Gets or Sets the Username;
String value representing the user name of the HTML document. By default ""
To know more details about windows authentication, refer this
link.
//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()
Gets or sets the margins of the page.
The , provides margins to the PDF page. By default , PDF margin is 0.
//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()
Gets or sets the Header to the PDF document;
The to draw into the PDF page. By default null
//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()
Gets or sets the Footer to the PDF document;
The to draw into the PDF page. By default null
//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()
Gets or sets the Orientation of the PDF document;
The , provides the orientation of the PDF page. By default Portrait
//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()
Gets or sets the size of the PDF page;
Default value: 595 * 842 pixels(A4 size)
//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()
Gets or sets the aspect ratio;
The ,By default None
//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()
Gets or sets the number of degrees by which the page should be rotated clockwise when displayed or printed.
The ,provides number of degrees by which the page should be rotated clockwise when displayed or printed
Default value: RotateAngle0
//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()
Gets or sets a value indicating whether [split text lines].
true if [Split Text lines]; otherwise, false.
//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()
Gets or sets a value indicating whether [split images].
true if [Split Images]; otherwise, false.
//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()
Gets or Sets a value indicating whether to auto-detect page-break in the webpage;
True if Page break is enabled, otherwise, false. Default is true
//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()
Set the maximum time in milliseconds to wait for HTML page to be loaded;
Specifies the timeout to the HTML converter.Unit is Milliseconds; By default 0
//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()
Gets or sets a value indicating whether to clear Internet cache;
True if the internetcache clears , otherwise false.
//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()
Gets or Sets a value indicating whether to Enable/Disable ActiveX contents in the webpage;
True if ActiveXControl enabled, otherwise false. Default is false
//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()
Gets or Sets a value indicating whether to Enable/Disable binary behaviors in the webpage;
true if [BinaryBehaviors enabled]; otherwise, false. Default is false
//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()
Gets or sets a value indicating the output PDF is tagged;
true if [Tagged PDF]; otherwise, false. Default is false
//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()
Gets or sets a value indicating the output PDF is A1B;
true if conformancelevel is PDFA1B; otherwise, false. Default is false
//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()
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.
//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()
Initializes a new instance of the class.
To know more details about IE rendering engine, refer this
link.
//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)
Class which represents the settings of WebKit rendering engine
//Initialize HtmlToPdfConverter class with WebKit rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(RenderEngine.WebKit);
//Setting properties for WebKit conversion.
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
webKitSettings.AdditionalDelay = 1000;
webKitSettings.WebKitPath = @"/QtBinaries/";
webKitSettings.AspectRatio = AspectRatio.None;
webKitSettings.EnableHyperLink = true;
webKitSettings.EnableJavaScript = true;
webKitSettings.Margin = new PdfMargins { All = 40 };
webKitSettings.Orientation = PdfPageOrientation.Portrait;
webKitSettings.Password = "";
webKitSettings.Username = "";
htmlConverter.ConverterSettings = webKitSettings;
//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 WebKit rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(RenderEngine.WebKit)
'Setting properties for WebKit conversion.
Dim webKitSettings As New WebKitConverterSettings()
webKitSettings.AdditionalDelay = 1000
webKitSettings.WebKitPath = @"/QtBinaries/"
webKitSettings.AspectRatio = AspectRatio.None
webKitSettings.EnableHyperLink = True
webKitSettings.EnableJavaScript = True
webKitSettings.Orientation = PdfPageOrientation.Portrait
webKitSettings.Password = ""
webKitSettings.Username = ""
htmlConverter.ConverterSettings = webKitSettings
'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)
class
class
Gets or sets the temp path where the temporary operations are performed if any;
Temp path which contains internal conversion files.By default %temp%
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Set Temporary Path to generate temporary files
settings.TempPath = @"C:/HtmlConversion/Temp/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim settings As WebKitConverterSettings = New WebKitConverterSettings
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Set Temporary Path to generate temporary files
settings.TempPath = "C:/HtmlConversion/Temp/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(true)
Gets or sets the additional delay to load JavaScript; Unit is Milliseconds;
A integer value indicating to apply delay for loading scripts.Unit is Milliseconds; By default 0
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set additional delay; units in milliseconds;
webKitSettings.AdditionalDelay = 3000;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set additional delay; units in milliseconds;
webKitSettings.AdditionalDelay = 3000
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not;
True if the Hyperlinks are enabled, otherwise false.Default is true
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Enable hyperlinks; By default - true
webKitSettings.EnableHyperLink = false;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Enable hyperlinks; By default - True
webKitSettings.EnableHyperLink = False
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets a value indicating whether to Enable/Disable JavaScripts in the webpage;
True if Javascript is enabled, otherwise,false. default is true
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Disable JavaScript; By default - true
webKitSettings.EnableJavaScript = false;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Disable JavaScript; By default True
webKitSettings.EnableJavaScript = False
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets the password;
String value representing the password of the HTML document. By default ""
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Set username and password to convert windows authenticated webpage to PDF.
webKitSettings.Username = "username";
webKitSettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set username and password to convert windows authenticated webpage to PDF.
webKitSettings.Username = "username"
webKitSettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets the Username;
String value representing the password of the HTML document. By default ""
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Set username and password to convert windows authenticated webpage to PDF.
webKitSettings.Username = "username";
webKitSettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set username and password to convert windows authenticated webpage to PDF.
webKitSettings.Username = "username"
webKitSettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the margins to the PDF document;
The , provides margins to the PDF page. By default , PDF margin is 0.
//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings.
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set margins
webKitSettings.Margin.All = 20;
//Assign WebKit settings to HTML converter.
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML string 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.WebKit)
'Initialize the WebKit converter settings.
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set margins
webKitSettings.Margin.All = 20
'Assign WebKit settings to HTML converter.
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML string to PDF.
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Header to the PDF document;
The to draw into the PDF page. By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Create PDF page template element for header with bounds.
PdfPageTemplateElement header = new PdfPageTemplateElement(new RectangleF(0, 0, webKitSettings.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 WebKit settings.
webKitSettings.PdfHeader = header;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Create PDF page template element for header with bounds.
Dim header As New PdfPageTemplateElement(New RectangleF(0, 0, webKitSettings.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 WebKit settings.
webKitSettings.PdfHeader = header
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Footer to the PDF document;
The to draw into the PDF page. By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Create PDF page template element for footer with bounds.
PdfPageTemplateElement footer = new PdfPageTemplateElement(new RectangleF(0, 0, webKitSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty);
//Assign the footer element to PdfFooter of WebKit settings.
webKitSettings.PdfFooter = footer;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Create PDF page template element for footer with bounds.
Dim footer As New PdfPageTemplateElement(New RectangleF(0, 0, webKitSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty)
'Assign the footer element to PdfFooter of WebKit settings.
webKitSettings.PdfFooter = footer
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Orientation of the PDF document;
The , provides the orientation of the PDF page.By default Portrait
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page orientation
webKitSettings.Orientation = PdfPageOrientation.Landscape;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page orientation
webKitSettings.Orientation = PdfPageOrientation.Landscape
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the size of the PDF page;
Default value: 595 * 842 pixels(A4 size)
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page size
webKitSettings.PdfPageSize = new SizeF(595, 842);
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page size
webKitSettings.PdfPageSize = New SizeF(595, 842)
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the aspect ratio;
The By default None
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set AspectRatio
webKitSettings.AspectRatio = AspectRatio.None;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set AspectRatio
webKitSettings.AspectRatio = AspectRatio.None
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the number of degrees by which the page should be rotated clockwise when displayed or printed.
The ,provides number of degrees by which the page should be rotated clockwise when displayed or printed
Default value: RotateAngle0
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set PDF page rotation angle
webKitSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set PDF page rotation angle
webKitSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets a value indicating whether [split text lines].
true if [Split Text lines]; otherwise, false.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set SplitTextLines to avoid text split between pages.
webKitSettings.SplitTextLines = false;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set SplitTextLines to avoid text split between pages.
webKitSettings.SplitTextLines = False
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets a value indicating whether [split images].
true if [Split Images]; otherwise, false.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Set SplitImages to avoid image split between pages.
webKitSettings.SplitImages = false;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Set SplitImages to avoid image split between pages.
webKitSettings.SplitImages = False
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets WebKit assembly path;
Specifies WebKit assemblies path.By default bin folder
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//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.WebKit)
'Initialize the WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKitPath
webKitSettings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
WebKit view port size;
By default use system ViewPort size
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set WebKit viewport size
webKitSettings.WebKitViewPort = new Size(800,0);
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set WebKit viewport size
webKitSettings.WebKitViewPort = New Size(800, 0)
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
A property indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not. By default the automatic bookmarks creation is disabled
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Enable bookmarks
webKitSettings.EnableBookmarks = true;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Enable bookmarks
webKitSettings.EnableBookmarks = True
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the document
document.Save("Output.pdf")
document.Close()
A property indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not. By default this property is false
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Enable table of contents
webKitSettings.EnableToc = true;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Enable table of contents
webKitSettings.EnableToc = True
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the document
document.Save("Output.pdf")
document.Close()
Gets or sets Toc styles
//Initialize HTML to PDF converter with WebKit Rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize HTML to PDF converter
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Enable TOC
webKitSettings.EnableToc = true;
//Set the style for level 1(H1) items in table of contents
HtmlToPdfTocStyle tocstyleH1 = new HtmlToPdfTocStyle();
tocstyleH1.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Regular);
tocstyleH1.BackgroundColor = new PdfSolidBrush(new PdfColor(Color.FromArgb(68, 114, 196)));
tocstyleH1.ForeColor = PdfBrushes.White;
tocstyleH1.Padding = new PdfPaddings(5, 5, 3, 3);
webKitSettings.Toc.SetItemStyle(1, tocstyleH1);
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with WebKit Rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize HTML to PDF converter
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Enable TOC
webKitSettings.EnableToc = True
'Set the style for level 1(H1) items in table of contents
Dim tocstyleH1 As New HtmlToPdfTocStyle()
tocstyleH1.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Regular)
tocstyleH1.BackgroundColor = New PdfSolidBrush(New PdfColor(Color.FromArgb(68, 114, 196)))
tocstyleH1.ForeColor = PdfBrushes.White
tocstyleH1.Padding = New PdfPaddings(5, 5, 3, 3)
webKitSettings.Toc.SetItemStyle(1, tocstyleH1)
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
Gets or sets cookie collection with names and values
The cookies Collection
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Add cookies as name and value pair
webKitSettings.Cookies.Add("CookieName1", " CookieValue1");
webKitSettings.Cookies.Add("CookieName2", " CookieValue2");
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Add cookies
webKitSettings.Cookies.Add("Name1", "Value1")
webKitSettings.Cookies.Add("Name2", "Value2")
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com ")
'Save and close the document
document.Save("Output.pdf")
document.Close()
Class
Gets or sets the HTTP post collection fields.
Presence of elements in this collection will initiate Post request or else it will proceed with Get request.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Add post parameters
webKitSettings.HttpPostFields.Add("firstName", "Andrew");
webKitSettings.HttpPostFields.Add("lastName", "Fuller");
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Add post parameters
webKitSettings.HttpPostFields.Add("firstName", "Andrew")
webKitSettings.HttpPostFields.Add("lastName", "Fuller")
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx")
'Save and close the document
document.Save("Output.pdf")
document.Close()
Gets or Sets the window status
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Set windows status.
webKitSettings.WindowStatus = "completed";
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set windows status.
webKitSettings.WindowStatus = "completed"
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close()
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.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set enable form
webKitSettings.EnableForm = true;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set enable form
webKitSettings.EnableForm = True
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close()
Gets or sets the repetition of table header. By enabling this property, will repeat the table header on every page break. The default value is false.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
// Enable html table header repeat on every page.
webKitSettings.EnableRepeatTableHeader = true;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
' Enable html table header repeat on every page.
webKitSettings.EnableRepeatTableHeader = True
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the repetition of table footer. By enabling this property, will repeat the table footer on every page break. The default value is false.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
// WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit binaries path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Enable html table footer repeat on every page.
webKitSettings.EnableRepeatTableFooter = true;
//Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
' WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit binaries path
webKitSettings.WebKitPath = "/QtBinaries/"
' Enable html table header repeat on every page.
webKitSettings.EnableRepeatTableHeader = True
'Enable html table footer repeat on every page.
webKitSettings.EnableRepeatTableFooter = True
'Assign the WebKit settings
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets media type of WebKit HTML converter
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set print media type
webKitSettings.MediaType = MediaType.Print;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set print media type
webKitSettings.MediaType = MediaType.Print
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets proxy server settings for WebKit HTML conversion
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy settings
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
webKitSettings.ProxySettings.Type = WebKitProxyType.Http;
webKitSettings.ProxySettings.Username = "username";
webKitSettings.ProxySettings.Password = "password";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy settings
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
webKitSettings.ProxySettings.Type = WebKitProxyType.Http
webKitSettings.ProxySettings.Username = "username"
webKitSettings.ProxySettings.Password = "password"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Enable Offline mode; default value false;
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Enable offline mode
webKitSettings.EnableOfflineMode = true;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Enable offline mode
webKitSettings.EnableOfflineMode = True
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Use this option to render the whole HTML content into a single PDF page
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Create a new instance for webkit converter settings.
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Set signle page layout.
settings.SinglePageLayout = SinglePageLayout.FitHeight;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://en.wikipedia.org/wiki/.NET_Framework");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Create a new instance for webkit converter settings.
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Set signle page layout.
settings.SinglePageLayout = SinglePageLayout.FitHeight
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://en.wikipedia.org/wiki/.NET_Framework")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the WebKit temporary process name
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Set file name for temporary files.
settings.TempFileName = @"syncfusiontempfile";
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim settings As WebKitConverterSettings = New WebKitConverterSettings
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Set file name for temporary files.
settings.TempPath = "syncfusiontempfile"
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(true)
Gets or sets a background color when converting a HTML document.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Set background color for conversion.
settings.BackgroundColor = Color.Red;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim settings As WebKitConverterSettings = New WebKitConverterSettings
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Set background color for conversion.
settings.BackgroundColor = "Color.Red
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(true)
Set the maximum time in milliseconds to wait for HTML page to be loaded;
Specifies the timeout to the HTML converter.Unit is Milliseconds; By default 0
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set timeout for conversion.
webKitSettings.Timeout = 3000;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set timeout for conversion.
webKitSettings.Timeout = 3000
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Initializes a new instance of the class.
//Initialize HtmlToPdfConverter class with WebKit rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(RenderEngine.WebKit);
//Setting properties for WebKit conversion.
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
webKitSettings.AdditionalDelay = 1000;
webKitSettings.WebKitPath = @"/QtBinaries/";
webKitSettings.AspectRatio = AspectRatio.None;
webKitSettings.EnableHyperLink = true;
webKitSettings.EnableJavaScript = true;
webKitSettings.Margin = new PdfMargins { All = 40 };
webKitSettings.Orientation = PdfPageOrientation.Portrait;
webKitSettings.Password = "";
webKitSettings.Username = "";
htmlConverter.ConverterSettings = webKitSettings;
//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 WebKit rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(RenderEngine.WebKit)
'Setting properties for WebKit conversion.
Dim webKitSettings As New WebKitConverterSettings()
webKitSettings.AdditionalDelay = 1000
webKitSettings.WebKitPath = @"/QtBinaries/"
webKitSettings.AspectRatio = AspectRatio.None
webKitSettings.EnableHyperLink = True
webKitSettings.EnableJavaScript = True
webKitSettings.Orientation = PdfPageOrientation.Portrait
webKitSettings.Password = ""
webKitSettings.Username = ""
htmlConverter.ConverterSettings = webKitSettings
'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)
class
class
Class which represents the settings of Blink rendering engine
//Initialize HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Gets or sets the temp path where the temporary operations are performed if any.
Temp path which contains internal conversion files.By default %temp%
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Set Temporary Path to generate temporary files
blinkConverterSettings.TempPath = @"C:/HtmlConversion/Temp/";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set Temporary Path to generate temporary files
blinkConverterSettings.TempPath = "C:/HtmlConversion/Temp/"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the TempFileName for the conversion
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Set name to the Temporary files
blinkConverterSettings.TempFileName = @"syncfusiontempfile";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set name to the Temporary files
blinkConverterSettings.TempFileName = "syncfusiontempfile"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the additional delay to load JavaScript;
Specifies the delay to load the scripts.Unit is Milliseconds; By default 0
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
// Set additional delay; units in milliseconds
blinkConverterSettings.AdditionalDelay = 3000;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set additional delay; units in milliseconds
blinkConverterSettings.AdditionalDelay = 3000
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or Sets a value indicating whether to preserve the live-links in the converted document or not.
True if the Hyperlinks are enabled, otherwise false.Default is true
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Enable hyperlinks; By default - true
blinkConverterSettings.EnableHyperLink = false;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = NewHtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Enable hyperlinks; By default - True
blinkConverterSettings.EnableHyperLink = False
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or Sets a value indicating whether to Enable/Disable JavaScripts in the webpage.
True if Javascript is enabled, otherwise,false. default is true
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Disable JavaScript; By default, true
blinkConverterSettings.EnableJavaScript = false;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Disable JavaScript; By default True
blinkConverterSettings.EnableJavaScript = False
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the Enable Offline mode; default value false;
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Enable offline mode
blinkConverterSettings.EnableOfflineMode = true;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Enable offline mode
blinkConverterSettings.EnableOfflineMode = True
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or Sets the password;
String value representing the password of the HTML document. By default ""
// Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
blinkConverterSettings.Username = "username";
blinkConverterSettings.Password = "password";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.example.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
blinkConverterSettings.Username = "username"
blinkConverterSettings.Password = "password"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.example.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or Sets the Username;
String value representing the user name of the HTML document. By default ""
// Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
blinkConverterSettings.Username = "username";
blinkConverterSettings.Password = "password";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.example.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
blinkConverterSettings.Username = "username"
blinkConverterSettings.Password = "password"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.example.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the margins of the page.
The , provides margins to the PDF page. By default , PDF margin is 0.
//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings.
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set margins
blinkSettings.Margin.All = 20;
//Assign Blink settings to HTML converter.
htmlConverter.ConverterSettings = blinkSettings;
//Convert HTML string 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.Blink)
'Initialize the Blink converter settings.
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Set margins
blinkSettings.Margin.All = 20
'Assign Blink settings to HTML converter.
htmlConverter.ConverterSettings = blinkSettings
'Convert HTML string to PDF.
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the Header to the PDF document;
The to draw into the PDF page. By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/";
//Create PDF page template element for header with bounds.
PdfPageTemplateElement header = new PdfPageTemplateElement(new RectangleF(0, 0, blinkSettings.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 Blink settings.
blinkSettings.PdfHeader = header;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings;
//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.Blink)
'Initialize the Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Create PDF page template element for header with bounds.
Dim header As New PdfPageTemplateElement(New RectangleF(0, 0, blinkSettings.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 Blink settings.
blinkSettings.PdfHeader = header
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Footer to the PDF document;
The to draw into the PDF page. By default null
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/";
//Create PDF page template element for footer with bounds.
PdfPageTemplateElement footer = new PdfPageTemplateElement(new RectangleF(0, 0, blinkSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty);
//Assign the footer element to PdfFooter of Blink settings.
blinkSettings.PdfFooter = footer;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings;
//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.Blink)
'Initialize the Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Create PDF page template element for footer with bounds.
Dim footer As New PdfPageTemplateElement(New RectangleF(0, 0, blinkSettings.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 footer string in footer template element.
footer.Graphics.DrawString("This is footer", font, brush, PointF.Empty)
'Assign the footer element to PdfFooter of Blink settings.
blinkSettings.PdfFooter = footer
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets the Orientation of the PDF document;
The , provides the orientation of the PDF page. By default Portrait
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/";
//Set PDF page orientation
blinkSettings.Orientation = PdfPageOrientation.Landscape;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings;
//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.Blink)
'Initialize the Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Set PDF page orientation
blinkSettings.Orientation = PdfPageOrientation.Landscape
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the size of the PDF page;
Default value: 595 * 842 pixels(A4 size)
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/";
//Set PDF page size
blinkSettings.PdfPageSize = new SizeF(595, 842);
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings;
//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.Blink)
'Initialize the Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Set PDF page size
blinkSettings.PdfPageSize = New SizeF(595, 842)
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or sets the number of degrees by which the page should be rotated clockwise when displayed or printed.
The ,provides number of degrees by which the page should be rotated clockwise when displayed or printed
Default value: RotateAngle0
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize the Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/";
//Set PDF page rotation angle
blinkSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings;
//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.Blink)
'Initialize the Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Set BlinkPath
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Set PDF page rotation angle
blinkSettings.PageRotateAngle = PdfPageRotateAngle.RotateAngle90
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = blinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Gets or Sets Blink folder path;
Specifies Blink binaries path.By default bin folder
//Initialize HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets media type of Blink rendering engine
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Set print media type
blinkConverterSettings.MediaType = MediaType.Print;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set print media type
blinkConverterSettings.MediaType = MediaType.Print
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Blink view port size; HTML Content will be scaled based on the given viewport size.
By default 1024x0 ViewPort size
//Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Set Blink viewport size
blinkConverterSettings.ViewPortSize = new Size(800, 0);
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com")
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set Blink viewport size
blinkConverterSettings.ViewPortSize = New Size(800, 0)
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Gets or sets the aspect ratio.
This property does not have any effect with Blink rendering engine.
Gets or sets a value indicating whether the text can be split across the PDF pages.
This property does not have any effect with Blink rendering engine.
Gets or sets a value indicating whether the images can be split across the PDF pages.
This property does not have any effect with Blink rendering engine.
Gets or sets the HTTP post collection fields.
Presence of elements in this collection will initiate Post request or else it will proceed with Get request.
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
// Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Assign the Blink binaries path
blinkSettings.BlinkPath = @"/BlinkBinaries/";
//Add post parameters
blinkSettings.HttpPostFields.Add("firstName", "Andrew");
blinkSettings.HttpPostFields.Add("lastName", "Fuller");
//Assign the Blink settings
htmlConverter.ConverterSettings = blinkSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Blink converter settings
Dim blinkSettings As New BlinkConverterSettings()
'Assign the Blink binaries path
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Add post parameters
blinkSettings.HttpPostFields.Add("firstName", "Andrew")
blinkSettings.HttpPostFields.Add("lastName", "Fuller")
'Assign the Blink settings
htmlConverter.ConverterSettings = blinkSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx")
'Save and close the document
document.Save("Output.pdf")
document.Close()
Gets or sets proxy server settings for Blink HTML conversion
//Initialize HTML converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Set Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Set manual proxy settings
BlinkSettings.ProxySettings.HostName = "127.0.0.1";
BlinkSettings.ProxySettings.PortNumber = 8080;
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with Blink rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim BlinkSettings As New BlinkConverterSettings()
'Set Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Set manual proxy settings
BlinkSettings.ProxySettings.HostName = "127.0.0.1"
BlinkSettings.ProxySettings.PortNumber = 8080
BlinkSettings.ProxySettings.Type = BlinkProxyType.Http
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = BlinkSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
class
Gets or sets cookie collection with names and values
The cookies Collection
// Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
// Add cookies as name and value pair
blinkConverterSettings.Cookies.Add("CookieName1", " CookieValue1");
blinkConverterSettings.Cookies.Add("CookieName2", " CookieValue2");
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.example.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Add cookies
blinkConverterSettings.Cookies.Add("Name1", "Value1")
blinkConverterSettings.Cookies.Add("Name2", "Value2")
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.example.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Class
Gets or Sets the window status
// Initialize the HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
// Set windows status.
blinkConverterSettings.WindowStatus = "completed";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Set windows status.
blinkConverterSettings.WindowStatus = "completed"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Use this option to render the whole HTML content into a single PDF page
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blinkconverter settings
BlinkConverterSettings settings = new BlinkConverterSettings();
//Set Blink path
settings.BlinkPath = "/BlinkBinaries/";
//Set single page layout
settings.SinglePageLayout = SinglePageLayout.FitWidth;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com/");
//Save and close the PDF document
document.Save("Sample.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blinkconverter settings
Dim settings As New BlinkConverterSettings()
'Set Blink path
settings.BlinkPath = "/BlinkBinaries/"
'Set single page layout
settings.SinglePageLayout = SinglePageLayout.FitWidth
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com/")
'Save and close the PDF document
document.Save("Sample.pdf")
document.Close(True)
Gets or sets the Blink command line arguments.
Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blink converter settings
BlinkConverterSettings BlinkSettings = new BlinkConverterSettings();
//Assign the Blink path
BlinkSettings.BlinkPath = @"/BlinkBinaries/";
//Add Blink command line arguments
BlinkSettings.CommandLineArguments.Add("--no-proxy-server");
htmlConverter.ConverterSettings = BlinkSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blink converter settings
Dim BlinkSettings As New BlinkConverterSettings()
'Assign the Blink path
BlinkSettings.BlinkPath = "/BlinkBinaries/"
'Add Blink command line arguments
BlinkSettings.CommandLineArguments.Add("--no-proxy-server")
htmlConverter.ConverterSettings = BlinkSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
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.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blinkconverter settings
BlinkConverterSettings settings = new BlinkConverterSettings();
//Set Blink path
settings.BlinkPath = "/BlinkBinaries/";
//Set enable form
settings.EnableForm = true;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com/");
//Save and close the PDF document
document.Save("Sample.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blinkconverter settings
Dim settings As New BlinkConverterSettings()
'Set Blink path
settings.BlinkPath = "/BlinkBinaries/"
'Set enable form
settings.EnableForm = true
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com/")
'Save and close the PDF document
document.Save("Sample.pdf")
document.Close(True)
A property indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not. By default the automatic bookmarks creation is disabled.
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blinkconverter settings
BlinkConverterSettings settings = new BlinkConverterSettings();
//Set Blink path
settings.BlinkPath = "/BlinkBinaries/";
//Set enable bookmarks
settings.EnableBookmarks = true;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com/");
//Save and close the PDF document
document.Save("Sample.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blinkconverter settings
Dim settings As New BlinkConverterSettings()
'Set Blink path
settings.BlinkPath = "/BlinkBinaries/"
'Set enable bookmarks
settings.EnableBookmarks = true
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com/")
'Save and close the PDF document
document.Save("Sample.pdf")
document.Close(True)
A property indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not. By default this property is false
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blinkconverter settings
BlinkConverterSettings settings = new BlinkConverterSettings();
//Set Blink path
settings.BlinkPath = "/BlinkBinaries/";
//Set enable toc
settings.EnableToc = true;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com/");
//Save and close the PDF document
document.Save("Sample.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blinkconverter settings
Dim settings As New BlinkConverterSettings()
'Set Blink path
settings.BlinkPath = "/BlinkBinaries/"
'Set enable toc
settings.EnableToc = true
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com/")
'Save and close the PDF document
document.Save("Sample.pdf")
document.Close(True)
Gets or sets Toc styles
//Initialize HTML to PDF converter with Blink Rendering Engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize HTML to PDF converter
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Assign the Blink binaries path
blinkSettings.BlinkPath = @"/BlinkBinaries/";
//Enable TOC
blinkSettings.EnableToc = true;
//Set the style for level 1(H1) items in table of contents
HtmlToPdfTocStyle tocstyleH1 = new HtmlToPdfTocStyle();
tocstyleH1.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Regular);
tocstyleH1.BackgroundColor = new PdfSolidBrush(new PdfColor(Color.FromArgb(68, 114, 196)));
tocstyleH1.ForeColor = PdfBrushes.White;
tocstyleH1.Padding = new PdfPaddings(5, 5, 3, 3);
blinkSettings.Toc.SetItemStyle(1, tocstyleH1);
//Assign the Blink settings
htmlConverter.ConverterSettings = blinkSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("input.html");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with Blink Rendering Engine.
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize HTML to PDF converter
Dim blinkSettings As New BlinkConverterSettings()
'Assign the Blink binaries path
blinkSettings.BlinkPath = "/BlinkBinaries/"
'Enable TOC
blinkSettings.EnableToc = True
'Set the style for level 1(H1) items in table of contents
Dim tocstyleH1 As New HtmlToPdfTocStyle()
tocstyleH1.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Regular)
tocstyleH1.BackgroundColor = New PdfSolidBrush(New PdfColor(Color.FromArgb(68, 114, 196)))
tocstyleH1.ForeColor = PdfBrushes.White
tocstyleH1.Padding = New PdfPaddings(5, 5, 3, 3)
blinkSettings.Toc.SetItemStyle(1, tocstyleH1)
'Assign the Blink settings
htmlConverter.ConverterSettings = blinkSettings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert("input.html")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
Gets or sets the scaling factor for HTML to PDF conversion.
Scaling factor range should from 0.1 to 2.0, otherwise the conversion gets failed
///
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
//Initialize Blinkconverter settings
BlinkConverterSettings settings = new BlinkConverterSettings();
//Set Blink path
settings.BlinkPath = "/BlinkBinaries/";
//Set scaling factor
settings.Scale = 1.0F;
//Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com/");
//Save and close the PDF document
document.Save("Sample.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
'Initialize Blinkconverter settings
Dim settings As New BlinkConverterSettings()
'Set Blink path
settings.BlinkPath = "/BlinkBinaries/"
'Set scaling factor
settings.Scale = 1.0F
'Assign Blink settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com/")
'Save and close the PDF document
document.Save("Sample.pdf")
document.Close(True)
Initializes a new instance of the class.
//Initialize HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = @"/BlinkBinaries/";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter with Blink rendering engine
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter(HtmlRenderingEngine.Blink)
Dim blinkConverterSettings As BlinkConverterSettings = New BlinkConverterSettings()
'Set the BlinkBinaries folder path
blinkConverterSettings.BlinkPath = "/BlinkBinaries/"
'Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
class
class
Specifies the Render Engine.
To know more details about rendering engines, refer this
link.
//Initialize the HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize the WebKit converter settings
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"/QtBinaries/";
//Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize the HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize the WebKit converter settings
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "/QtBinaries/"
'Assign WebKit settings to the HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
IE engine convert the HTML
WebKit engine convert the HTML
Blink engine convert the HTML
Delete the file
check conversion is success or not in surrogate process and throws the relevent exception
Converts html to image.
Converted image's stream.
Converts html to image.
Converted image's stream.
Entry point for the x64 process and process the OCR
Entry point for HTML to Image conversion
Entry point for HTML to SVG conversion
Entry point for HTML to MHTML conversion
Specifies the media type of WebKit converter
//Initialize HTML converter with WebKit rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Set WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set print media type
webKitSettings.MediaType = MediaType.Print;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save the document.
document.Save("Sample.pdf");
document.Close();
'Initialize HTML converter with WebKit rendering engine
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim webKitSettings As New WebKitConverterSettings()
'Set WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set print media type
webKitSettings.MediaType = MediaType.Print
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save the document.
document.Save("Sample.pdf")
document.Close()
Print media type
Screen media type
Type of proxy server
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Initialize WebKit converter settings
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
//Assign the WebKit path
webKitSettings.WebKitPath = @"/QtBinaries/";
//Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1";
webKitSettings.ProxySettings.PortNumber = 8080;
//Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Initialize WebKit converter settings
Dim webKitSettings As New WebKitConverterSettings()
'Assign the WebKit path
webKitSettings.WebKitPath = "/QtBinaries/"
'Set manual proxy with proxy server host and port number.
webKitSettings.ProxySettings.HostName = "127.0.0.1"
webKitSettings.ProxySettings.PortNumber = 8080
'Set proxy server type
webKitSettings.ProxySettings.Type = WebKitProxyType.Http
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = webKitSettings
'Convert url to pdf
Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
No proxy type
Http proxy type
Http caching proxy type
Socks5 proxy type
Contains native function declarations.
Windows message.
Windows message.
Windows message.
Windows message.
Windows message.
Windows message.
Windows message.
Windows message.
Windows message.
HRESULT S_OK constant.
HRESULT S_OK constant.
Creates new object.
System enum.
System enum.
System enum.
System enum.
System struct.
System interface.
System interface.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System method.
System interface.
System method.
System method.
System method.
System method.
System method.
System method.
Adds a directory to the search path used to locate DLLs for the application.
The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is NULL, the function restores the default search order.
If the function succeeds, the return value is nonzero.
Waits until the specified object is in the signaled state or the time-out interval elapses.
A handle to the object. If this handle is closed while the wait is still pending,
the function's behavior is undefined.
The time-out interval, in milliseconds. If a nonzero value is specified,
the function waits until the object is signaled or the interval elapses.
If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled;
it always returns immediately. If dwMilliseconds is INFINITE, the function will return only when the object is signaled
If the function succeeds, the return value indicates the event that caused the function to return.
Closes an open object handle.
A valid handle to an open object.
If the function succeeds, the return value is nonzero.
The ImpersonateLoggedOnUser function lets the calling thread impersonate the security context of a logged-on user.
The user is represented by a token handle.
A handle to a primary or impersonation access token that represents a logged-on user. .
If the function succeeds, the return value is nonzero.
The DuplicateToken function creates a new access token that duplicates one already in existence.
A handle to an access token opened with TOKEN_DUPLICATE access.
Specifies a SECURITY_IMPERSONATION_LEVEL enumerated type that supplies the impersonation level of the new token.
A pointer to a variable that receives a handle to the duplicate token. This handle has TOKEN_IMPERSONATE and TOKEN_QUERY access to the new token.
If the function succeeds, the return value is nonzero .
Windows API constants and functions
GUID representation of IIDs and CLSIDs
Holds the Infinite value
Holds the Infinite value for wait failed
Holds the value of the target platform
Launch the 32 bit surrogate process
Path of the surrogate process
Create a 32 bit surrogate process application
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
Looks up a localized string similar to The requested security protocol is not supported..
Looks up a localized string similar to This operation is not supported for a relative URI..
Looks up a localized string similar to The WebSocket client request requested '{0}' protocol(s), but server is only accepting '{1}' protocol(s)..
Looks up a localized string similar to There is already one outstanding '{0}' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time..
Looks up a localized string similar to The WebSocket has already been started..
Looks up a localized string similar to The message type '{0}' is not allowed for the '{1}' operation. Valid message types are: '{2}, {3}'. To close the WebSocket, use the '{4}' operation instead. .
Looks up a localized string similar to The argument must be a value greater than {0}..
Looks up a localized string similar to An internal WebSocket error occurred. Please see the innerException, if present, for more details. .
Looks up a localized string similar to The WebSocket protocol '{0}' is invalid because it contains the invalid character '{1}'..
Looks up a localized string similar to The close status code '{0}' is reserved for system use only and cannot be specified when calling this method..
Looks up a localized string similar to The close status description '{0}' is too long. The UTF8-representation of the status description must not be longer than {1} bytes..
Looks up a localized string similar to Empty string is not a valid subprotocol value. Please use \"null\" to specify no value..
Looks up a localized string similar to The '{0}' header value '{1}' is invalid..
Looks up a localized string similar to The WebSocket is in an invalid state ('{0}') for this operation. Valid states are: '{1}'.
Looks up a localized string similar to The '{0}' instance cannot be used for communication because it has been transitioned into the '{1}' state..
Looks up a localized string similar to Duplicate protocols are not allowed: '{0}'..
Looks up a localized string similar to The WebSocket is not connected..
Looks up a localized string similar to The close status description '{0}' is invalid. When using close status code '{1}' the description must be null..
Looks up a localized string similar to Only Uris starting with 'ws://' or 'wss://' are supported..
Looks up a localized string similar to The WebSocket protocol is not supported on this platform..
Looks up a localized string similar to Unable to connect to the remote server.
Looks up a localized string similar to The base stream is not readable..
Looks up a localized string similar to The base stream is not writeable..