Click or drag to resize
ImgConverter Class
This class offers the necessary API to create images in various formats from a specified web page
Inheritance Hierarchy
SystemObject
  ExpertPdf.HtmlToPdfImgConverter

Namespace: ExpertPdf.HtmlToPdf
Assembly: ExpertPdf.HtmlToPdf (in ExpertPdf.HtmlToPdf.dll) Version: 11.0.0
Syntax
public class ImgConverter

The ImgConverter type exposes the following members.

Constructors
  NameDescription
Public methodImgConverter
Creates an image converter that auto detects the width and height of the web page
Public methodImgConverter(Int32)
Creates an image converter for a web page with the specified width and an autodected height
Public methodImgConverter(Int32, Int32)
Creates an image converter for a web page with the specified width and height
Top
Methods
  NameDescription
Public methodGetImageBytesFromHtmlFile
Gets binary format of an image generated from the specified HTML file in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlStream(Stream, Encoding, ImageFormat)
Gets binary format of an image generated from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlStream(Stream, Encoding, ImageFormat, String)
Gets binary format of an image generated from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlStreamWithTempFile(Stream, Encoding, ImageFormat)
Gets binary format of an image generated from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format. The htmlStream is first saved in a temporary file. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlStreamWithTempFile(Stream, Encoding, ImageFormat, String)
Gets binary format of an image generated from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format. The htmlStream is first saved in a temporary file. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlStream parameter. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlString(String, ImageFormat)
Gets binary format of an image generated from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlString(String, ImageFormat, String)
Gets binary format of an image generated from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter.
Public methodGetImageBytesFromHtmlStringWithTempFile(String, ImageFormat)
Gets binary format of an image generated from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format. The htmlString is first saved into a temporary file before performing the conversion The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromHtmlStringWithTempFile(String, ImageFormat, String)
Gets binary format of an image generated from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format. The htmlString is first saved into a temporary file before performing the conversion. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageBytesFromUrl
Gets binary format of an image generated from the specified URL in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response.
Public methodGetImageFromHtmlFile
Gets an System.Drawing.Image object from the specified HTML file in the the specified System.Drawing.Imaging.ImageFormat format
Public methodGetImageFromHtmlStream(Stream, Encoding, ImageFormat)
Gets an System.Drawing.Image object from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format
Public methodGetImageFromHtmlStream(Stream, Encoding, ImageFormat, String)
Gets an System.Drawing.Image object from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlStream parameter.
Public methodGetImageFromHtmlStreamWithTempFile(Stream, Encoding, ImageFormat)
Gets an System.Drawing.Image object from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format by writing first the stream in a temporary file
Public methodGetImageFromHtmlStreamWithTempFile(Stream, Encoding, ImageFormat, String)
Gets an System.Drawing.Image object from the specified HTML stream in the the specified System.Drawing.Imaging.ImageFormat format by writing first the stream in a temporary file. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter.
Public methodGetImageFromHtmlString(String, ImageFormat)
Gets an System.Drawing.Image object from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format
Public methodGetImageFromHtmlString(String, ImageFormat, String)
Gets an System.Drawing.Image object from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter.
Public methodGetImageFromHtmlStringWithTempFile(String, ImageFormat)
Gets an System.Drawing.Image object from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format by writing first the HTML string in a temporary file
Public methodGetImageFromHtmlStringWithTempFile(String, ImageFormat, String)
Gets an System.Drawing.Image object from the specified HTML string in the the specified System.Drawing.Imaging.ImageFormat format by writing first the HTML string in a temporary file. The urlBase parameter allows the converter to determine the full URLs from relative URLs for images and CSS files appearing in the HTML code from htmlString parameter.
Public methodGetImageFromUrl
Gets an System.Drawing.Image object from the specified URL in the the specified System.Drawing.Imaging.ImageFormat format
Public methodGetImageFromUrlBytes Obsolete.
Gets binary format of an image generated from the specified URL in the the specified System.Drawing.Imaging.ImageFormat format. The bytes can be further written in any stream like a disk file or a web response.
Public methodSaveImageFromHtmlFileToFile
This method produces a image from the specified HTML file in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Public methodSaveImageFromHtmlStreamToFile(Stream, Encoding, ImageFormat, String)
This method produces a image from the specified HTML stream in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Public methodSaveImageFromHtmlStreamToFile(Stream, Encoding, ImageFormat, String, String)
This method produces a image from the specified HTML stream in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Public methodSaveImageFromHtmlStreamToFileWithTempFile(Stream, Encoding, ImageFormat, String)
This method produces a image from the specified HTML stream in the specified format and saves the image in the specified disk file by writing first the HTML stream into a temporary file. The existing file will be overwritten.
Public methodSaveImageFromHtmlStreamToFileWithTempFile(Stream, Encoding, ImageFormat, String, String)
This method produces a image from the specified HTML stream in the specified format and saves the image in the specified disk file by writing first the HTML stream into a temporary file. The existing file will be overwritten.
Public methodSaveImageFromHtmlStringToFile(String, ImageFormat, String)
This method produces a image from the specified HTML string in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Public methodSaveImageFromHtmlStringToFile(String, ImageFormat, String, String)
This method produces a image from the specified HTML string in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Public methodSaveImageFromHtmlStringToFileWithTempFile(String, ImageFormat, String)
This method produces a image from the specified HTML string in the specified format and saves the image in the specified disk file by writing first the HTML string into a temporary file. The existing file will be overwritten.
Public methodSaveImageFromHtmlStringToFileWithTempFile(String, ImageFormat, String, String)
This method produces a image from the specified HTML string in the specified format and saves the image in the specified disk file by writing first the HTML string into a temporary file. The existing file will be overwritten.
Public methodSaveImageFromUrlToFile
This method produces a image from the specified URL in the specified format and saves the image in the specified disk file. The existing file will be overwritten
Top
Properties
  NameDescription
Public propertyActiveXEnabled
Enable ActiveX controls when rendering HTML to image. Default is true. Note: This is used only by the IE rendering engine.
Public propertyAddPadding
Add padding at the end of the conversion result. Default is false.
Public propertyAuthenticationPassword
Optionally set the Password property to authenticate to web server before accessing the URL to be converted (e.g handles any IIS authentication method)
Public propertyAuthenticationUsername
Optionally set the Username property to authenticate to web server before accessing the URL to be converted (e.g handles any IIS authentication method)
Public propertyBatchConversion
Set this true when using the converter for batch conversion. Note: This is used only by the IE rendering engine.
Public propertyBehaviorsEnabled
Enable behaviors when rendering HTML to image. Default is false. Note: This is used only by the IE rendering engine.
Public propertyBinaryBehaviorsEnabled
Internal use. Default is false.
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 PageWidth property. The default value of this property is false. Note: This is used only by the WebKit rendering engine.
Public propertyConversionDelay
An additional time in seconds to wait for asynchronous items to be loaded
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 propertyHttpRequestHeaders
Gets or sets a string containing the HTTP headers sent by the convertor to the web server when the web page is requested from a URL. The HTTP headers string can be used to define cookies, authentication options, URL referer or any other HTTP header to be sent to the web browser. Note: This is used only by the IE rendering engine.
Public propertyInternalFileName
Sets the full path of the helper file. Note: This is used only by the WebKit rendering engine.
Public propertyInternetSecurityZone
Specifies the internet security zone settings used by the HTML converter to convert web sites. Note: This is used only by the IE rendering engine.
Public propertyLicenseKey
Gets or sets the license key
Public propertyNavigationTimeout
The navigation timeout in seconds. Default value is 60.
Public propertyPageHeight
Gets or sets the web page height. If the width was not set aswell, this property has no effect
Public propertyPageWidth
Gets or sets the web page width
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 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 propertySamplingEnabled
Internal use only
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. Note: This is used only by the IE rendering engine.
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 propertyxDf
Internal use only
Top
See Also