HiQPdf Documentation

PdfHtmlImage Class

Quickly Create High Quality PDFs
An object of this class can be laid out in any position in a PDF document to render a HTML content as image in place. Multiple objects of this type can be laid out in the same PDF page and even overlapped.
Inheritance Hierarchy

SystemObject
  HiQPdfPdfObject
    HiQPdfPdfDrawableObject
      HiQPdfHtmlObjectBase
        HiQPdfPdfHtmlImage

Namespace:  HiQPdf
Assembly:  HiQPdf (in HiQPdf.dll) Version: 15.0.0.0
Syntax

public sealed class PdfHtmlImage : HtmlObjectBase

The PdfHtmlImage type exposes the following members.

Constructors

  NameDescription
Public methodPdfHtmlImage
Creates an empty HTML to Image object. The UrlToConvert property or the HtmlToConvert property must be set after object creation
Public methodPdfHtmlImage(String)
Creates an object to convert the HTML from a given URL to an image and render the resulted image in the top left corner of the PDF page to which this object is added
Public methodPdfHtmlImage(String, String)
Creates an object to convert the given HTML code to an image and render the resulted image in the top left corner of the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, String)
Creates an object to convert the HTML from a given URL to an image and render the resulted image at the given coordinate in the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, Single, String)
Creates an object to convert the HTML from a given URL to an image and render the resulted image at the given coordinate and having a given width in the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, String, String)
Creates an object to convert the given HTML code to an image and render the resulted image at the given coordinate in the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, Single, Single, String)
Creates an object to convert the HTML from a given URL to an image and render the resulted image within a given destination box in the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, Single, String, String)
Creates an object to convert the given HTML code to an image and render the resulted image at the given coordinate and having a given width in the PDF page to which this object is added
Public methodPdfHtmlImage(Single, Single, Single, Single, String, String)
Creates an object to convert the HTML from a given URL to an image and render the resulted image within a given destination box in the PDF page to which this object is added
Top
Properties

  NameDescription
Public propertyAcceleratedCanvasEnabled
Controls if the accelerated canvas is enabled. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyAuthentication
The object exposed by this propery encapsulates a username and a password that can be used to access web pages requiring HTTP authentication in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyBackColor
The PDF object back color
(Inherited from PdfDrawableObject.)
Public propertyBaseUrl
The base URL that can be used to resolve the relative URLs found in the HTML code to convert
Public propertyBlendingMode
The blending mode when this object is drawn in PDF. This property is Normal by default
(Inherited from PdfDrawableObject.)
Public propertyBottomPadding
A padding to insert under the content rendered by this image object in a PDF page
Public propertyBreakAfterHtmlElements
An array of HTML CSS selectors to select the HTML elements that will receive a page break after them in PDF document
(Inherited from HtmlObjectBase.)
Public propertyBreakBeforeHtmlElements
An array of HTML CSS selectors to select the HTML elements that will receive a page break before them in PDF document
(Inherited from HtmlObjectBase.)
Public propertyBreakInsideAvoidHtmlElements
An array of HTML CSS selectors to select the HTML elements not accepting page breaks inside them
(Inherited from HtmlObjectBase.)
Public propertyBrowserHeight
The browser window height in pixels in this HTML object. The default height is set to render the entire HTML document
(Inherited from HtmlObjectBase.)
Public propertyBrowserUserAgent
The browser custom user agent
(Inherited from HtmlObjectBase.)
Public propertyBrowserWidth
The browser window width in pixels in this HTML object. The default width is 1200 pixels
(Inherited from HtmlObjectBase.)
Public propertyBrowserZoom
The browser window zoom percentage. The default zoom is 100
(Inherited from HtmlObjectBase.)
Public propertyClipRectangle
The clip rectangle applied when drawing the object in PDF
(Inherited from PdfDrawableObject.)
Public propertyConversionInfo
This property is initialized after conversion with an object containing information about the converted HTML document, about the HTML elements in the HTML document and about the regions rendered in the PDF document
(Inherited from HtmlObjectBase.)
Public propertyConvertedHtmlElementSelector
This property can be set with a value representing the CSS selector of the HTML element to be converted in this HTML object. If many elements in the HTML document are selected, only the the first one will be converted. The values of the attributes in the CSS selectors are case sensitive. If this property is not set then the whole HTML document is converted
(Inherited from HtmlObjectBase.)
Public propertyConvertHttpLinks
Controls if the HTTP links in the HTML document are converted to HTTP links in PDF in this HTML object. This property is true by default
(Inherited from HtmlObjectBase.)
Public propertyConvertInternalLinks
Controls if the internal links in HTML are converted to internal links in PDF in this HTML object. This property is true by default
(Inherited from HtmlObjectBase.)
Public propertyCropping
Controls is the HTML is cropped at the end of PDF page where it is rendered. This property is false by default and the HTML rendering can continue on the next page if necessary
Public propertyDefaultCharset
The default character set to be used when the character set meta tag is not set in HTML document header
(Inherited from HtmlObjectBase.)
Public propertyDestHeight
The destination rectangle height in points
Public propertyDestWidth
The destination rectangle width in points
Public propertyDestX
The destination rectangle top left corner X coordinate in points
Public propertyDestY
The destination rectangle top left corner Y coordinate in points
Public propertyEnableTableOfContents
Controls if the PDF document table of contents is created for the HTML document being converted to image. The default value is true
Public propertyFitDestHeight
Controls if the content is scaled down to fit the PDF destination height iof this HTML object. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyFitDestWidth
Controls if the content is scaled down to fit the PDF destination width of this HTML object. This property is true by default. When this property is true the images and the text font can be smaller than in HTML
(Inherited from HtmlObjectBase.)
Public propertyForceFitDestWidth
Controls if the content can be enlarged to fit the PDF destination width of this HTML object when FitDestWidth is true. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyForceNewPdfPages
Controls if a new PDF page is always created when the HTML object is laid out on the next PDF page. By default this property is false and if there is a next page already created in PDF document it will be used to layout this object
(Inherited from HtmlObjectBase.)
Public propertyForceResourcesDownload
Controls if the HTML converter object should force all possible resources to be downloaded in this HTML object. The default value is false
(Inherited from HtmlObjectBase.)
Public propertyForeColor
The PDF object fore color
(Inherited from PdfDrawableObject.)
Public propertyGradient
The PDF object gradient color
(Inherited from PdfDrawableObject.)
Public propertyHtmlLoadedTimeout
The maximum time in seconds to wait for HTML document to be loaded in this HTML object. The default value is 120 seconds. An exception is thrown if the HTML document cannot be loaded in HtmlLoadedTimeout seconds
(Inherited from HtmlObjectBase.)
Public propertyHtmlToConvert
The HTML code to convert
Public propertyHttp2Enabled
Controls if the HTTP2 protocol is enabled in NG version for this HTML object. The default value is false
(Inherited from HtmlObjectBase.)
Public propertyHttpCookies
A collection of HTTP cookies to be used when accessing a web page in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyHttpHeaders
A collection of the HTTP headers to be used when accessing a web page in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyHttpPostFields
A collection of HTTP POST fields to be used when accessing a web page in this HTML object. If the collection is not empty, the converter will make a POST request to the web page URL with the fields from this collection.
(Inherited from HtmlObjectBase.)
Public propertyImagesCutAllowed
Controls if cutting images between PDF pages is permitted. This property is true by default
(Inherited from HtmlObjectBase.)
Public propertyImpersonation
The object exposed by this propery encapsulates the properties controlling the internal browser impersonation in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyLayoutWithHinting
Controls if the hinting is used to layout HTML in this HTML object. Layout hinting is disabled by default. Enabling this property can improve the layout but it can make the conversion slower
(Inherited from HtmlObjectBase.)
Public propertyLineStyle
The style of the lines rendered by this object
(Inherited from PdfDrawableObject.)
Public propertyLiveExcludedElements
Controls if the HTML elements excluded from rendering are live in PDF. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyLocalFilesLoadEnabled
Controls if the local files can be loaded by converter. This property is true by default
(Inherited from HtmlObjectBase.)
Public propertyLocalStorageEnabled
Controls if the local web storage is enabled. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyManualTriggerWaitBeforeConvert
An additional time in seconds to wait before starting the conversion when the triggering mode is set to manual
(Inherited from HtmlObjectBase.)
Public propertyMaxBrowserHeight
This property can be used to set a maximum limit in pixels for the rendered top part of a HTML document in this HTML object. The default value is 0 and the height is not limited
(Inherited from HtmlObjectBase.)
Public propertyMaxImageTileHeight
The maximum height in pixels of the image tiles captured by converter in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyMediaType
Controls the media type for which to render the HTML document in this HTML object. If this property is null or empty the default media type is 'screen'. It can be set to a value like 'print' and in this case the CSS properties defined by the '@media print' rule will be used when the HTML is rendered
(Inherited from HtmlObjectBase.)
Public propertyMinBrowserHeight
This property can be used to set a minimum height in pixels to be rendered in this HTML object. The default value is 0 pixels. This property is ignored when the BrowserHeight property is set
(Inherited from HtmlObjectBase.)
Public propertyOpacity
The element opacity as a value between 0 which means completely transparent to 100 which means completely opaque. The object is completely opaque by default
(Inherited from PdfDrawableObject.)
Public propertyOutlines
Controls the outlines automatically generated by this HTML object
(Inherited from HtmlObjectBase.)
Public propertyProbeLayout
Controls if the HTML converter object should do a probe layout first in this HTML object. The default value is false
(Inherited from HtmlObjectBase.)
Public propertyProxy
The object exposed by this property encapsulates the parameters (address, username, password) that can be used to access web pages through a proxy server in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyRenderSvgFonts
Controls if the SVG fonts are rendered in this HTML object. The default value is false when converting HTML to PDF or SVG and true when converting HTML to a raster image
(Inherited from HtmlObjectBase.)
Public propertyRenderWebFonts
Controls if the Web Fonts are rendered in this HTML object. The default value is true
(Inherited from HtmlObjectBase.)
Public propertyRepeatHttpHeaders
This property controls if the headers defined by the HttpHeaders property are also used when accessing the resources referenced by the web page, not only when accessing the web page in this HTML object. The default value is true and the headers are repeated when accessing the referenced resources
(Inherited from HtmlObjectBase.)
Public propertyRetrieveExcludedElements
Controls if the HTML elements excluded from rendering can be selected for detailed information retrieval. This property is true by default
(Inherited from HtmlObjectBase.)
Public propertyRunExtensions
Controls if the browser extensions like Flash players are executed in this HTML object. The default value is false and no extension is executed
(Inherited from HtmlObjectBase.)
Public propertyRunJavaScript
Controls if the JavaScript in the HTML document is executed in this HTML object. The default value of this property is true and the JavaScript is executed
(Inherited from HtmlObjectBase.)
Public propertySelectedHtmlElements
An array of HTML CSS selectors to select the HTML elements for which to retrieve detailed information in SelectedHtmlElementsInfo collection exposed by ConversionInfo property in this HTML object
(Inherited from HtmlObjectBase.)
Public propertyStartBrowserHeight
This property can be used to set the starting height in pixels of the browser. This property is ignored when the BrowserHeight property is set
(Inherited from HtmlObjectBase.)
Public propertyStopSlowScripts
Controls if the browser should interrupt slow scripts in the web page in this HTML object. The default value is false and the scripts are not stopped
(Inherited from HtmlObjectBase.)
Public propertyTopPadding
A padding to insert above the content rendered by this image object in a PDF page
Public propertyTransform3DEnabled
Controls if the 3D transformations are enabled. This property is false by default
(Inherited from HtmlObjectBase.)
Public propertyTriggerMode
The method of triggering the conversion in HTML object. The default value is Auto
(Inherited from HtmlObjectBase.)
Public propertyTrimToBrowserWidth
If the HTML document cannot be entirely displayed in BrowserWidth pixels and the TrimToBrowserWidth is false then the browser window width will be automatically set to display the entire HTML document in this HTML object. If the HTML document cannot be entirely displayed in BrowserWidth pixels and the TrimToBrowserWidth is true then the browser window width will not be automatically set to display the entire HTML document and the HTML document will be trimmed
(Inherited from HtmlObjectBase.)
Public propertyUrlToConvert
The URL to convert
Public propertyWaitBeforeConvert
An additional time in seconds to wait before starting the conversion to allow more time to JavaScript to update the web page in this HTML object. When the property is set with a positive value the TriggerMode property is automatically set to WaitTime. This property has effect only if the TriggerMode property is WaitTime
(Inherited from HtmlObjectBase.)
Public propertyWebGLEnabled
Controls if the WebGL is enabled. This property is false by default
(Inherited from HtmlObjectBase.)
Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSetDepFilePath
Call this method of a HTML object with the fully qualified name of HiQPdf.dep when this file is installed in a different folder from the HiQPdf.dll folder
(Inherited from HtmlObjectBase.)
Public methodSetRotationAngle
Sets the clockwise rotation angle of the coordinates system before drawing this object in PDF
(Inherited from PdfDrawableObject.)
Public methodSetScaling
Sets the horizontal and vertical scaling of the coordinates system before drawing this object in PDF
(Inherited from PdfDrawableObject.)
Public methodSetSkewAngles
Sets the clockwise skew angles of the coordinates system before drawing this object in PDF
(Inherited from PdfDrawableObject.)
Public methodSetTranslation
Sets the horizontal and vertical translation of the coordinates system before drawing this object in PDF
(Inherited from PdfDrawableObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events

  NameDescription
Public eventPageCreatingEvent
This event can be used to configure the PDF page before starting layouting. For example, it is possible to set a custom header and footer for page or to hide the header and footer from page. The event handler must be set before adding this object to a page
Public eventPageLayoutingEndedEvent
The event is raised after the converter finished to layout the objects in a PDF page. This event can be used to layout PDF objects in the foreground of the PDF page after the main HTML content was laid out in page. The event handler must be set before adding this object to a page
Public eventPageLayoutingEvent
The event is raised when the HTML to Image object prepares to layout the objects in a PDF page. This event can be used to layout PDF objects in the background of the PDF page before the main HTML content is laid out in page. The event handler must be set before adding this object to a page
Top
See Also

Reference