Click or drag to resize

HtmlToImageElement Class

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.
Inheritance Hierarchy
SystemObject
  ExpertPdf.HtmlToPdf.PdfDocumentPageElement
    ExpertPdf.HtmlToPdf.PdfDocumentPageGraphicElement
      ExpertPdf.HtmlToPdf.PdfDocumentHtmlToImageElement

Namespace: ExpertPdf.HtmlToPdf.PdfDocument
Assembly: ephtmltopdf (in ephtmltopdf.dll) Version: 21.1.0
Syntax
public sealed class HtmlToImageElement : PageGraphicElement

The HtmlToImageElement type exposes the following members.

Constructors
 NameDescription
Public methodHtmlToImageElement(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 methodHtmlToImageElement(String, String) Creates a HTML string to image converter element that will be rendered 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 methodHtmlToImageElement(Single, Single, 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 methodHtmlToImageElement(Single, Single, Single, 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 methodHtmlToImageElement(Single, Single, String, String) Creates a HTML string 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 methodHtmlToImageElement(Single, Single, Single, Single, String) Creates a URL to image converter element at the specified x and y coordinates with the specified width and height.
Public methodHtmlToImageElement(Single, Single, Single, String, Int32) 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 methodHtmlToImageElement(Single, Single, Single, String, String) Creates a HTML string to image converter element at the specified x and y coordinates with the specified width. The height in PDF is auto determined.
Public methodHtmlToImageElement(Single, Single, Single, Single, String, String) Creates a HTML string to image converter element at the specified x and y coordinates with the specified width and height.
Public methodHtmlToImageElement(Single, Single, Single, String, String, Int32) Create a HTML string 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 methodHtmlToImageElement(Single, Single, Single, Single, String, Int32, Int32) 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 paramenters.
Public methodHtmlToImageElement(Single, Single, Single, Single, String, Int32, Int32, String) 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 paramenters.
Public methodHtmlToImageElement(Single, Single, Single, Single, String, String, Int32, Int32) Creates a HTML string 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 is specified by the htmlViewerWidth and htmlViewerHeight parameters.
Public methodHtmlToImageElement(Single, Single, Single, Single, String, String, String, Int32, Int32) Creates a HTML string 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 is specified by the htmlViewerWidth and htmlViewerHeight parameters.
Top
Properties
 NameDescription
Public propertyAddPadding Add padding at the end of the conversion result. Default is false.
Public propertyAllowLocalAccess A flag indicating if local files can be loaded during the conversion. The default value is True and local files can be loaded.
Public propertyAuthenticationOptions Server authentication options (e.g IIS authentication)
Public propertyBackColor Gets or sets element background color.
(Inherited from PageGraphicElement)
Public propertyBatchConversion Set this true when using the converter for batch conversion in a loop
Public propertyBehaviorsEnabled Enable behaviors when rendering HTML to image. Default is false.
Public propertyBinaryBehaviorsEnabled Internal use. Default is false.
Public propertyBlending Gets or sets blending mode for transparent rendering mode of the element.
(Inherited from PageGraphicElement)
Public propertyCacheFolder Use this property to enable caching of web requests. Sets the full path of the local cache folder. Note: This is used only by the WebKit rendering engine.
Public propertyClipHtmlView 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 width is given by the HtmlViewerWidth property. The default value of this property is false. Note: This is used only by the WebKit rendering engine.
Public propertyColorSpace Gets or sets color space for element rendering.
(Inherited from PageGraphicElement)
Public propertyConversionDelay An additional time in seconds to wait for asynchronous items to be loaded
Public propertyFitHeight 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 propertyFitWidth 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 propertyForeColor Gets or sets the element foreground color.
(Inherited from PageGraphicElement)
Public propertyGradient The gradient used to fill a shape.
(Inherited from PageGraphicElement)
Public propertyHtmlDocumentInfo Gets an object populated after conversion with the title, keywords, and description of the converted HTML document.
Public propertyHtmlElementsMappingOptions Gets a reference to the object controlling the retrieval of HTML elements position in the generated PDF. In order to retrieve the position in PDF for a list of HTML elements, the HtmlElementIds property of HtmlElementsMappingOptions must be set with an array of strings containing the HTML IDs of the HTML elements. 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 propertyHtmlViewerHeight Gets or sets the HTML viewer height in pixels. If the viewer width was not set, this property has no effect
Public propertyHtmlViewerWidth Gets or sets the HTML viewer width in pixels
Public propertyHttpCookies Gets a collection of custom HTTP cookies to be sent by the 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 HttpCookies property. Note: This is used only by the WebKit rendering engine.
Public propertyHttpHeaders Gets a collection of custom HTTP headers to be sent by the 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 HttpHeaders property. The custom HTTP headers can be used to define cookies, authentication options, URL referer or any other HTTP header to be sent to the web browser. The preferred method to send cookies is to use the HttpCookies property. Note: This is used only by the WebKit rendering engine.
Public propertyInternalFileName Sets the full path of the helper file. Note: This is used only by the WebKit rendering engine.
Public propertyInternalLinksEnabled When true this options instructs the converter to convert the internal HTML links to internal PDF links. The default value is true.
Public propertyInternetSecurityZone Specifies the internet security zone settings used by the HTML converter to convert web sites.
Public propertyLineStyle Gets or sets the line style for elements rendering lines.
(Inherited from PageGraphicElement)
Public propertyLiveUrlsEnabled When true this options instructs the converter to convert the HTML links in PDF links. The default value is true.
Public propertyNavigationTimeout The navigation timeout in seconds. Default value is 60.
Public propertyOptimizeMemoryUsage When this property is true the library will try to release the unused memory as soon as possible. The default value is false.
Public propertyPaginate When true the element can be paginated
Public propertyPdfBookmarkOptions Gets a reference to the object controlling the bookmarks creation for the rendered PDF document. In order to enable creation of bookmarks you have to set the TagNames property of PdfBookmarkOptions with the names of the HTML tags you want to bookmark.
Public propertyPluginsEnabled A flag indicating if plugins are enabled in converter. The default is true. Note: This is used only by the WebKit rendering engine.
Public propertyProxyOptions Gets a reference to an object encapsulating the proxy options used to access the HTML document to convert. Note: This is used only by the WebKit rendering engine.
Public propertyRenderedPagesRectangles The bounds of the rendered rectangle on each PDF page. This property is assigned after the element has been added to a PDF page.
Public propertyRenderElementId Use this property to convert only a certain section of the page, specified by the html element ID. Note: This is used only by the WebKit rendering engine.
Public propertyRenderingEngine Gets or sets the rendering engine used by the converter to load and render the html. The possible values are WebKit and IE. The Webkit rendering engine is internal and renders similar to Chrome and Safari. For IE, the component uses the IE engine from the machine.
Public propertyRotated A flag to indicate if this element was rotated.
(Inherited from PageGraphicElement)
Public propertySamplingEnabled Internal use only
Public propertyScaled A flag to indicate if this element was scaled.
(Inherited from PageGraphicElement)
Public propertyScriptsEnabled Enable scripts when rendering HTML to image. Default is true.
Public propertySerializeLoadHtml A flag indicating if the download and execution of the HTML code is serialized when the converter is called simultaneously from multiple threads of an application. Default value is false.
Public propertyShowFooterOnEvenPages Show or not the document footer on even pages generated by this element. By default the footer is displayed both on odd and even pages.
Public propertyShowFooterOnOddPages Show or not the document footer on odd pages generated by this element. By default the footer is displayed both on odd and even pages. The ShowFooterTemplate property of the page to which this element is added has priority over ShowFooterOnOddPages.
Public propertyShowHeaderOnEvenPages Show or not the document header on even pages generated by this element. By default the header is displayed both on odd and even pages.
Public propertyShowHeaderOnOddPages Show or not the document header on odd pages generated by this element. By default the header is displayed both on odd and even pages. The ShowHeaderTemplate property of the page to which this element is added has priority over ShowHeaderOnOddPages.
Public propertySkewed A flag to indicate if this element was skewed.
(Inherited from PageGraphicElement)
Public propertyStartupMode Use this property to specify the converter startup mode. By default this is set to Automatic and the conversion is started as soon as the page loads (and ConversionDelay elapses). If set to Manual, the conversion is started only by a javascript call to ExpertPdfJSObj.startConversion() Note: This is used only by the WebKit rendering engine.
Public propertyStartupScript Use this property to specify some JavaScript code that will be injected into the page that is converted. The JavaScript code specified here will run before any other script on the page. Note: This is used only by the WebKit rendering engine.
Public propertyStretchToFit This property has effect 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 propertyTranslated A flag to indicate if this element was translated.
(Inherited from PageGraphicElement)
Public propertyTransparency Gets or sets element transparency. The transparency is expressed as a value between 0 and 100. 0 means completely transparent and 100 completely opaque.
(Inherited from PageGraphicElement)
Top
Methods
 NameDescription
Public methodGetImage Renders a System.Drawing.Image object from HTML
Public methodRotate Rotates the coordinate system axes clockwise by the specified angle before rendering the element. The coordinates of the element are relative to the rotated coordinates system.
(Inherited from PageGraphicElement)
Public methodScale Scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size as sx and sy units, respectively, in the previous coordinate system.
(Inherited from PageGraphicElement)
Public methodSkew Skews the x axis by an skewXAngle and the y axis by an skewYAngle before rendering the element.
(Inherited from PageGraphicElement)
Public methodTranslate Translates the coordinate system before rendering the element. The coordinates of the element are relative to the translated coordinate system.
(Inherited from PageGraphicElement)
Top
Fields
 NameDescription
Public fieldStatic memberAUTO_HTML_VIEWER_HEIGHT_PX The default virtual browser height in pixels is set to autodetect the HTML content height.
Public fieldStatic memberAUTO_PDF_HEIGHT_POINTS The default width in PDF of the element is set to available width in PDF page.
Public fieldStatic memberAVAILABLE_PDF_WIDTH_POINTS The default width in PDF of the element is set to available width in PDF page.
Public fieldStatic memberDEFAULT_HTML_VIEWER_WIDTH_PX The default virtual browser width in pixels
Top
See Also