Table of Contents

Class HtmlToImageElement

Namespace
EvoPdf
Assembly
evohtmltopdf.dll

This class encapsulates a HTML to Image converter. The HTML to Image conversion is performed when the element is added to a PDF page. The resulted image is embedded in the PDF document.

[ClassInterface(ClassInterfaceType.AutoDual)]
public sealed class HtmlToImageElement : PageGraphicElement
Inheritance
HtmlToImageElement
Inherited Members

Constructors

HtmlToImageElement(float, float, float, float, string)

Creates a URL to image converter element at the specified x and y coordinates with the specified width and height.

public HtmlToImageElement(float x, float y, float width, float height, string urlToConvert)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

urlToConvert string

The URL to convert to PDF

HtmlToImageElement(float, float, float, float, string, int, int)

Create a URL to image converter element at the specified x and y coordinates with the specified width and height. The virtual browser width and height in pixels are specified by the htmlViewerWidth and htmlViewerHeight parameters.

public HtmlToImageElement(float x, float y, float width, float height, string urlToConvert, int htmlViewerWidth, int htmlViewerHeight)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

urlToConvert string

The URL to convert to PDF

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from HTML document content.

htmlViewerHeight int

The virtual browser height in pixels. The default value is 0 which means the height will be auto-determined. The effect of this parameter is similar with viewing the HTML page in a browser window ` with the specified width and height. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page height from the HTML document content.

HtmlToImageElement(float, float, float, float, string, int, int, string)

Create a URL to image converter element at the specified x and y coordinates with the specified width and height using a document URL to resolve the internal links. The virtual browser width and height in pixels are specified by the htmlViewerWidth and htmlViewerHeight parameters.

public HtmlToImageElement(float x, float y, float width, float height, string urlToConvert, int htmlViewerWidth, int htmlViewerHeight, string internalLinksBaseUrl)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

urlToConvert string

The URL to convert to PDF

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from the HTML document content.

htmlViewerHeight int

The virtual browser height in pixels. The default value is 0 which means the height will be auto-determined. The effect of this parameter is similar with viewing the HTML page in a browser window ` with the specified width and height. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page height from the HTML document content.

internalLinksBaseUrl string

The full URL of the document referenced by the internal links from the HTML document. This parameter is necessary when the converted URL is not the full URL of a document.

HtmlToImageElement(float, float, float, float, string, string)

Creates a HTML string to image converter element at the specified x and y coordinates with the specified width and height using a base URL to resolve the external resources.

public HtmlToImageElement(float x, float y, float width, float height, string htmlStringToConvert, string htmlStringBaseURL)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

HtmlToImageElement(float, float, float, float, string, string, int, int)

Creates a HTML string to image converter element at the specified x and y coordinates with the specified width and height using a base URL to resolve the external resources. The virtual browser width and height in pixels is specified by the htmlViewerWidth and htmlViewerHeight parameters.

public HtmlToImageElement(float x, float y, float width, float height, string htmlStringToConvert, string htmlStringBaseURL, int htmlViewerWidth, int htmlViewerHeight)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from the HTMl document content.

htmlViewerHeight int

The virtual browser height in pixels. The default value is 0 which means the height will be auto-determined. The effect of this parameter is similar with viewing the HTML page in a browser window ` with the specified width and height. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page height from the HTML document content.

HtmlToImageElement(float, float, float, float, string, string, string, int, int)

Creates a HTML string to image converter element at the specified x and y coordinates with the specified width and height using a base URL to resolve the external resources and a document URL to resolve the internal links. The virtual browser width and height in pixels is specified by the htmlViewerWidth and htmlViewerHeight parameters.

public HtmlToImageElement(float x, float y, float width, float height, string htmlStringToConvert, string htmlStringBaseURL, string internalLinksBaseUrl, int htmlViewerWidth, int htmlViewerHeight)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

height float

The destination height in points for the rendered content. If the specified height is less or equal 0, the destination height will be auto determined so all the content can be rendered. Please note that the specified height is the effective height that will be rendered in the PDF document and does not include for example the empty spaces introduced by custom or auomatic page breaks.

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

internalLinksBaseUrl string

The full URL of the document referenced by the internal links from the HTML string.

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from the HTML document content.

htmlViewerHeight int

The virtual browser height in pixels. The default value is 0 which means the height will be auto-determined. The effect of this parameter is similar with viewing the HTML page in a browser window ` with the specified width and height. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page height from HTML document content.

HtmlToImageElement(float, float, float, string)

Creates a URL to image converter element at the specified x and y coordinates with the specified width. The height in PDF is auto determined.

public HtmlToImageElement(float x, float y, float width, string urlToConvert)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

urlToConvert string

The URL to convert to PDF

HtmlToImageElement(float, float, float, string, int)

Creates a URL to image converter element at the specified x and y coordinates with the specified width. The height in PDF is auto determined. The virtual browser width in pixels is specified by the htmlViewerWidth parameter.

public HtmlToImageElement(float x, float y, float width, string urlToConvert, int htmlViewerWidth)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

urlToConvert string

The URL to convert to PDF

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from the HTML document content.

HtmlToImageElement(float, float, float, string, string)

Creates a HTML string to image converter element at the specified x and y coordinates with the specified width using a base URL to resolve the external resources. The height in PDF is auto determined.

public HtmlToImageElement(float x, float y, float width, string htmlStringToConvert, string htmlStringBaseURL)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

HtmlToImageElement(float, float, float, string, string, int)

Create a HTML string to image converter element at the specified x and y coordinates with the specified width using a base URL to resolve the external resources. The height in PDF is auto determined. The virtual browser width in pixels is specified by the htmlViewerWidth parameter.

public HtmlToImageElement(float x, float y, float width, string htmlStringToConvert, string htmlStringBaseURL, int htmlViewerWidth)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed

width float

The destination width in points for the rendered content. If the specified with is less or equal 0, the destination width will be given by the available width in page

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

htmlViewerWidth int

The virtual browser width in pixels. The default value is 1024 pixels. The effect of this parameter is similar with viewing the HTML page in a browser window with the specified width. When this parameter is less or equal 0, the converter will try to auto-determine the HTML page width from the HTML document content.

HtmlToImageElement(float, float, string)

Creates a URL to image converter element at the specified x and y coordinates in PDF page. The width of element in PDF page is the available width in PDF page and the height is auto determined.

public HtmlToImageElement(float x, float y, string urlToConvert)

Parameters

x float

The x position in points where the rendered content will be placed

y float

The y position in points where the rendered content will be placed the destination width will be given by the available width in page

urlToConvert string

The URL to convert to PDF

HtmlToImageElement(float, float, string, string)

Creates a HTML string to image converter element at the specified x and y coordinates in PDF page using a base URL to resolve the external resources. The width of element in PDF page is the available width in PDF page and the height is auto determined

public HtmlToImageElement(float x, float y, string htmlStringToConvert, string htmlStringBaseURL)

Parameters

x float

The x position in points where the rendered content will be placed.

y float

The y position in points where the rendered content will be placed.

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

HtmlToImageElement(string)

Creates a URL to image converter element at the (0,0) location in PDF page. The width of element in PDF page is the available width in PDF page and the height is auto determined.

public HtmlToImageElement(string urlToConvert)

Parameters

urlToConvert string

The URL to convert to PDF

HtmlToImageElement(string, string)

Creates a HTML string to image converter element that will be rendered at the (0,0) location in PDF page using a base URL to resolve the external resources. The width of element in PDF page is the available width in PDF page and the height is auto determined.

public HtmlToImageElement(string htmlStringToConvert, string htmlStringBaseURL)

Parameters

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL. When this parameter is NULL no base URL will be used.

HtmlToImageElement(string, string, string)

Creates a HTML string to image converter element at the top left corner in PDF page using a base URL to resolve the external resources and a document URL to resolve the internal links. The width of element in PDF page is the available width in PDF page and the height is auto determined.

public HtmlToImageElement(string htmlStringToConvert, string htmlStringBaseURL, string internalLinksBaseUrl)

Parameters

htmlStringToConvert string

The HTML string convert to PDF.

htmlStringBaseURL string

The full URL of the page from where this string was taken used to resolve the images and CSS files referenced by a relative URL in the HTML string. This parameter is optional and the default value is NULL.

internalLinksBaseUrl string

The full URL of the document referenced by the internal links from the HTML string. When this parameter is NULL no base URL will be used.

Fields

AUTO_HTML_VIEWER_HEIGHT_PX

The default virtual browser height in pixels is set to autodetect the HTML content height.

public const int AUTO_HTML_VIEWER_HEIGHT_PX = 0

Field Value

int

AUTO_PDF_HEIGHT_POINTS

The default width in PDF of the element is set to available width in PDF page.

public const int AUTO_PDF_HEIGHT_POINTS = -1

Field Value

int

AVAILABLE_PDF_WIDTH_POINTS

The default width in PDF of the element is set to available width in PDF page.

public const int AVAILABLE_PDF_WIDTH_POINTS = -1

Field Value

int

DEFAULT_HTML_VIEWER_WIDTH_PX

The default virtual browser width in pixels

public const int DEFAULT_HTML_VIEWER_WIDTH_PX = 1024

Field Value

int

Properties

AuthenticationOptions

This property can be set with an username and a password in order to authenticate to the web server before accessing the URL to be converted in HTML to Image element. They can be used for example to resolve the IIS Integrated Windows Authentication or other types of IIS authentication.

public AuthenticationOptions AuthenticationOptions { get; }

Property Value

AuthenticationOptions

AvoidHtmlElementsBreakSelectors

Gets or sets the CSS selectors of the HTML elements to not be broken between PDF pages if possible when the HTML to Image element is rendered

public string[] AvoidHtmlElementsBreakSelectors { get; set; }

Property Value

string[]

AvoidImageBreak

When true this property instructs the HTML to Image element converter to try to avoid cutting off the images between PDF pages

public bool AvoidImageBreak { get; set; }

Property Value

bool

BaseUrl

Gets or sets the base URL of the HTML string to be converted to image

public string BaseUrl { get; set; }

Property Value

string

BottomSpacing

A space in points to introduce at the bottom of PDF pages where the HTML is rendered to image. 1 point is 1/72 inch. By default the bottom spacing is 0.

public float BottomSpacing { get; set; }

Property Value

float

ClipHtmlView

If the HTML content is not entirely visible in the HTML viewer of the HTML to Image element at the specified width, the ClipHtmlView property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. The HTML viewer width is given by the HtmlViewerWidth property. The default value of this property is false.

public bool ClipHtmlView { get; set; }

Property Value

bool

ConversionDelay

An additional time in seconds to wait for asynchronous items to be completely loaded or for a web page redirect to finish before starting the rendering in HTML to Image element. Default value is 0.

public int ConversionDelay { get; set; }

Property Value

int

DefaultHtmlEncoding

The default HTML document text encoding to be used if there is no charset meta tag defined in the HTML document. By default this property is not set and an auto determined text encoding will be used by converter

public string DefaultHtmlEncoding { get; set; }

Property Value

string

DownloadAllResources

Gets or sets a flag indicating if the HTML to Image element should try to download all the resources even if this could cause a slower conversion. The default value is false

public bool DownloadAllResources { get; set; }

Property Value

bool

Enable3DTransformations

Gets or sets a flag indicating if the accelerated CSS 3D transformations are enabled in the HTML to Image element converter. The default value is false

public bool Enable3DTransformations { get; set; }

Property Value

bool

EnableAccelerated2DCanvas

Gets or sets a flag indicating if the accelerated 2D canvas is enabled in the HTML to Image element converter. The default value is false

public bool EnableAccelerated2DCanvas { get; set; }

Property Value

bool

EnableHttp2

Gets or sets a flag indicating if the HTTP2 protocol is enabled in HTML to Image element converter. The property has effect only in NE version of the library. The default value is false

public bool EnableHttp2 { get; set; }

Property Value

bool

EnablePersistentStorage

Gets or sets a flag indicating if the persistent local storage is enabled in the HTML to Image element converter. The default value is false

public bool EnablePersistentStorage { get; set; }

Property Value

bool

EnableWebGL

Gets or sets a flag indicating if the WebGL is enabled in the HTML to Image element converter. The default value is false

public bool EnableWebGL { get; set; }

Property Value

bool

EvoInternalFileName

Sets the full path of evointernal.dat helper file of the HTML to Image element. By default this file is expected to be found in the same folder with evohtmltopdf.dll assembly.

public string EvoInternalFileName { set; }

Property Value

string

ExtensionsEnabled

Gets or sets a flag indicating if the HTML viewer extensions are executed in the HTML to Image element converter. The default value is false and no extension is executed. The Flash player for Mozilla Firefox must be installed in order to execute the flash content from HTML

public bool ExtensionsEnabled { get; set; }

Property Value

bool

FitHeight

When this property is true the resulted image will be resized if necessary to fit the available height in PDF page. By default this property is false.

public bool FitHeight { get; set; }

Property Value

bool

FitWidth

When this property is true the resulted image will be resized if necessary to fit the available width in PDF page. When false the image will be rendered at the real size. By default this property is true and the image will be resized if necessary to fit the available width in PDF page

public bool FitWidth { get; set; }

Property Value

bool

Height

Gets or sets the destination height in points of the rendered image. If the specified height is less or equal to 0, the destination height will be auto determined so all the content can be rendered.

public float Height { get; set; }

Property Value

float

Html

Gets or sets the HTML string to be converted to image

public string Html { get; set; }

Property Value

string

HtmlDocumentInfo

Gets an object populated after conversion with the title, keywords, and description of the converted HTML document rendered by the HTML to Image element.

public HtmlDocumentInfo HtmlDocumentInfo { get; }

Property Value

HtmlDocumentInfo

HtmlElementsMappingOptions

Gets a reference to the object that can be used to obtain the position in PDF of the HTML elements rendered by the HTML to Image element. In order to retrieve the position in PDF for a list of HTML elements, the HtmlElementSelectors property of HtmlElementsMappingOptions class must be set with an array of strings containing the CSS selectors of the HTML elements you want to map. The positions of the HTML elements in the generated PDF document will be returned in the HtmlElementsMappingResult object after the element was added to the page.

public HtmlElementsMappingOptions HtmlElementsMappingOptions { get; }

Property Value

HtmlElementsMappingOptions

HtmlViewerHeight

Gets or sets the HTML viewer height in pixels of the HTML to Image element. If the specified HTML viewer height is 0 the HTML viewer height will be automatically determined based on the HTML content and the HTML viewer width in order to make visible the whole HTML content. The HTML viewer width is given by the HtmlViewerWidth property of the HtmlToImageElement class. If the HTML content is not entirely visible in the HTML viewer at the specified width, the ClipHtmlView property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. The HTML viewer height can also be specified in the HtmlToImageElement class contructor. The default value is 0 to automatically determine the HTML viewer height based on the HTML content and the HTML viewer width.

public int HtmlViewerHeight { get; set; }

Property Value

int

HtmlViewerWidth

Gets or sets the preferred HTML viewer width in pixels of the HTML to Image element. If the HTML content is not entirely visible in the HTML viewer at the specified width, the ClipHtmlView property will control whether the HTML content is clipped or the HTML viewer width is automatically extended to make visible the whole HTML content. By default the ClipHtmlView property is false and the HTML viewer is automatically extended in width to make visible the whole HTML content. The HTML viewer width can also be specified in the HtmlToImageElement class constructor. The default value is 1024 pixels.

public int HtmlViewerWidth { get; set; }

Property Value

int

HtmlViewerZoom

Gets or sets the HTML viewer zoom percentage in HTML to Image element similar to zoom level in a browser. The default value of this property is 100

public int HtmlViewerZoom { get; set; }

Property Value

int

HttpPostFields

Returns the collection of HTTP POST fields to be used when accessing a web page in HTML to Image element. If there are elements in collection then the converter will make a POST request to the web page URL with the fields from this collection, otherwise it will make a GET request

public NameValueCollection HttpPostFields { get; }

Property Value

NameValueCollection

HttpRequestCookies

Gets a collection of custom HTTP cookies to be sent by the HTML to Image element converter to the web server when the web page to convert and the resources (image, css, etc) referenced by the web page are requested. A cookie is defined by a name and a value pair that can be added to the collection using the Add(string, string) method of the HttpRequestCookies property.

public NameValueCollection HttpRequestCookies { get; }

Property Value

NameValueCollection

HttpRequestHeaders

Gets a collection of custom HTTP headers to be sent by the HTML to Image element converter to the web server when the web page is requested from a URL. A custom HTTP header is defined by a name and a value pair that can be added to the collection using the Add(string, string) method of the HttpRequestHeaders property. The PersistentHttpRequestHeaders property can be set on true to instruct the converter to send the custom headers each time an external resource (image, css, etc) referenced by the web page is requested. By default the PersistentHttpRequestHeaders property is false and the custom headers are not automatically sent to the web server when the web page resources are requested. The custom HTTP headers can be used to define cookies, authentication options, URL referrer or any other HTTP header to be sent to the web browser. The preferred method to send cookies is to use the HttpRequestCookies property.

public NameValueCollection HttpRequestHeaders { get; }

Property Value

NameValueCollection

ImagePartSize

Gets or sets the maximum height in pixels of an image part in HTML to Image element

public int ImagePartSize { get; set; }

Property Value

int

ImpersonationOptions

The impersonation options applied during navigation in HTML to Image element

public ImpersonationOptions ImpersonationOptions { get; }

Property Value

ImpersonationOptions

InitialHtmlViewerHeight

Gets or sets the initial height in pixels of the HTML viewer in HTML to Image element. This value of this property is ignored if the HtmlViewerHeight property is set

public int InitialHtmlViewerHeight { get; set; }

Property Value

int

InsertNewPagesEnabled

A flag indicating if the HTML to Image element will always insert a new page in the PDF document when rendering next page instead of trying to use an already existing PDF page. This property is false by default

public bool InsertNewPagesEnabled { get; set; }

Property Value

bool

InteractiveHiddenElements

A flag indicating if the interactive features are enabled for hidden HTML elements. This property is false by default

public bool InteractiveHiddenElements { get; set; }

Property Value

bool

InternalLinksEnabled

When true this option instructs the HTML to Image element converter to convert the internal HTML links to internal PDF links. The default value is true.

public bool InternalLinksEnabled { get; set; }

Property Value

bool

InterruptSlowJavaScript

Gets or sets a flag indicating if the slow JavaScript script should be interrupted in HTML to Image element converter. The default value is false and the scripts are not interrupted

public bool InterruptSlowJavaScript { get; set; }

Property Value

bool

JavaScriptEnabled

A flag indicating if JavaScript execution is enabled in the HTML to Image element converter. The default is true.

public bool JavaScriptEnabled { get; set; }

Property Value

bool

LiveUrlsEnabled

When true this option instructs the HTML to Image element converter to convert the HTML links to PDF links. The default value is true.

public bool LiveUrlsEnabled { get; set; }

Property Value

bool

LocalFilesAccessEnabled

Gets or sets a flag indicating if the access to local files is enabled in the HTML to Image element converter. The default value is true

public bool LocalFilesAccessEnabled { get; set; }

Property Value

bool

ManualTriggeringConversionDelay

An additional time in seconds to wait after manual triggering before starting the rendering in HTML to Image element. Default value is 0.

public int ManualTriggeringConversionDelay { get; set; }

Property Value

int

MaxHtmlViewerHeight

Gets or sets the maximum height in pixels to be rendered from the HTML document by the HTML to Image element. The default value is 0 and the entire HTML document is rendered

public int MaxHtmlViewerHeight { get; set; }

Property Value

int

MediaType

Gets or sets the media type of the HTML document used by the HTML to Image element. The default media type is 'screen'. If you set this property with 'print' then the CSS properties defined in '@media print' rule will be used to render the document

public string MediaType { get; set; }

Property Value

string

MinHtmlViewerHeight

Gets or sets the minimum height in pixels to be rendered from HTML document by the HTML to Image element. This value of this property is ignored if the HtmlViewerHeight property is set

public int MinHtmlViewerHeight { get; set; }

Property Value

int

NavigationTimeout

The HTML to Image element converter navigation timeout in seconds. Default value is 60.

public int NavigationTimeout { get; set; }

Property Value

int

NavigatorUserAgent

The custom user agent to be used when accessing the HTML page. When this property is null or empty the default user agent is used

public string NavigatorUserAgent { get; set; }

Property Value

string

PageBreakAfterHtmlElementsSelectors

Gets or sets the CSS selectors of the HTML elements after which to force a page break in PDF document

public string[] PageBreakAfterHtmlElementsSelectors { get; set; }

Property Value

string[]

PageBreakBeforeHtmlElementsSelectors

Gets or sets the CSS selectors of the HTML elements before which to force a page break in PDF document

public string[] PageBreakBeforeHtmlElementsSelectors { get; set; }

Property Value

string[]

Paginate

When this property is true the HTML to Image element can be paginated to render many PDF pages if necessary.

public bool Paginate { get; set; }

Property Value

bool

PdfBookmarkOptions

Gets a reference to the object controlling the bookmarks creation in PDF for the HTML to Image element. In order to enable creation of bookmarks you have to set the HtmlElementSelectors property of PdfBookmarkOptions class with the CSS selectors of the HTML elements you want to bookmark.

public PdfBookmarkOptions PdfBookmarkOptions { get; }

Property Value

PdfBookmarkOptions

PersistentHttpRequestHeaders

This property can be set on true to instruct the HTML to Image element converter to send the custom headers defined by the HttpRequestHeaders property each time an external resource (image, css, etc) referenced by the web page is requested. The default value of this property is true and the custom headers are automatically sent to the web server when the web page resources are requested.

public bool PersistentHttpRequestHeaders { get; set; }

Property Value

bool

PrerenderEnabled

Gets or sets a flag indicating if the HTML to Image element should perform a pre-rendering. The default value is false

public bool PrerenderEnabled { get; set; }

Property Value

bool

ProxyOptions

Gets a reference to an object encapsulating the proxy options used by the HTML to Image element to access the HTML document to convert.

public ProxyOptions ProxyOptions { get; }

Property Value

ProxyOptions

RenderedHtmlElementSelector

Get or set the CSS selector of the HTML element to be rendered by the HTML to Image element. If the selector selects multiple HTML elements, only the the first one will be converted. The CSS selector is case sensitive. If this property is not set then the entire HTML document is rendered

public string RenderedHtmlElementSelector { get; set; }

Property Value

string

RenderedPagesRectangles

The bounds of the rectangle rendered in each PDF page by the HTML to Image element. This property is assigned after the element has been added to a PDF page.

public RectangleF[] RenderedPagesRectangles { get; }

Property Value

RectangleF[]

StretchToFit

This property has effect in HTML to Image element only when FitWidth property is true. When FitWidth is true and this property is true the HTML content will be stretched if necessary to fit the available width in PDF page. By default this property is false and the content will not be stretched to fit the available width in PDF page.

public bool StretchToFit { get; set; }

Property Value

bool

SvgFontsEnabled

Gets or sets a flag indicating if the SVG fonts are enabled in HTML to Image element converter. The default value is true

public bool SvgFontsEnabled { get; set; }

Property Value

bool

TableOfContentsEnabled

Get or sets a flag indicating if this HTML to PDF element can contribute to the PDF document table of contents. The PDF document table of contents is controlled by TableOfContents property. Default value is true

public bool TableOfContentsEnabled { get; set; }

Property Value

bool

TopSpacing

A space in points to introduce at the top of PDF pages where the HTML is rendered to image. 1 point is 1/72 inch. By default the top spacing is 0.

public float TopSpacing { get; set; }

Property Value

float

TriggeringMode

The conversion triggering mode used by the HTML to Image element converter. The default value is Auto.

public TriggeringMode TriggeringMode { get; set; }

Property Value

TriggeringMode

Url

Gets or sets the URL of the HTML document to be converted to image

public string Url { get; set; }

Property Value

string

WebFontsEnabled

Gets or sets a flag indicating if the Web Fonts are enabled in HTML to Image element converter. The default value is true

public bool WebFontsEnabled { get; set; }

Property Value

bool

Width

Gets or sets the destination width in points of the rendered image. If the specified width is less or equal to 0, the destination width will be given by the available width in page

public float Width { get; set; }

Property Value

float

X

Gets or sets the x position in points where the rendered image will be placed in PDF page

public float X { get; set; }

Property Value

float

XPSupplementalLanguages

A flag in HTML to Image element indicating if the supplemental languages (complex script, right-to-left, East Asian) support was enabled in Windows XP Regional and Language Options. The default value is false.

public bool XPSupplementalLanguages { get; set; }

Property Value

bool

Y

Gets or sets the y position in points where the rendered image will be placed in PDF page

public float Y { get; set; }

Property Value

float

Events

AfterRenderPdfPageEvent

The event is raised right after the HTML to Image element finished PDF page rendering. The PDF page configuration like size, orientation, header or footer is already defined and cannot be changed. In the handler of this event PDF elements can be added in the foreground of the rendered PDF page.

public event AfterRenderPdfPageDelegate AfterRenderPdfPageEvent

Event Type

AfterRenderPdfPageDelegate

BeforeRenderPdfPageEvent

The event is raised right before the page is rendered by HTML to Image element. The PDF page configuration like size, orientation, header or footer is already defined and cannot be changed. In the handler of this event PDF elements can be added in the background of the PDF page to be rendered.

public event BeforeRenderPdfPageDelegate BeforeRenderPdfPageEvent

Event Type

BeforeRenderPdfPageDelegate

PrepareRenderPdfPageEvent

The event is raised after the HTML to Image element created the PDF page and before starting rendering it. In the handler of this event the PDF page configuration like size, orientation, header or footer can still be changed before starting rendering.

public event PrepareRenderPdfPageDelegate PrepareRenderPdfPageEvent

Event Type

PrepareRenderPdfPageDelegate