Class ImgConverter
- Namespace
- EvoPdf
- Assembly
- evohtmltopdf.dll
This class represents the HTML to Image converter and offers the necessary properties and methods to convert HTML documents to raster images. This class is still present in the API to maintain the backward compatibility and it will be replaced by HtmlToImageConverter class in the future versions
[ClassInterface(ClassInterfaceType.AutoDual)]
public class ImgConverter : HtmlToImageConverter
- Inheritance
-
ImgConverter
- Inherited Members
Constructors
ImgConverter()
This constructor creates a HTML to Image converter using the default width and height for the HTML viewer
public ImgConverter()
ImgConverter(int)
This constructor creates a HTML to Image converter using the given width in pixels and the default height for the HTML viewer
public ImgConverter(int htmlViewerWidth)
Parameters
htmlViewerWidth
intThe HTML viewer width in pixels
ImgConverter(int, int)
This constructor creates a HTML to Image converter using the given width and height in pixels of the HTML viewer
public ImgConverter(int htmlViewerWidth, int htmlViewerHeight)
Parameters
htmlViewerWidth
intThe HTML viewer width in pixels
htmlViewerHeight
intThe HTML viewer height in pixels
Methods
GetImageBytesFromHtmlFile(string, ImageFormat)
Converts a HTML file to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFile(string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromHtmlFile(string htmlFilePath, ImageFormat format)
Parameters
htmlFilePath
stringThe HTML file to convert
format
ImageFormatThe image format
Returns
- byte[]
The created image bytes
GetImageBytesFromHtmlStream(Stream, Encoding, ImageFormat)
Converts the HTML string read from a stream to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStream(Stream, Encoding, string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromHtmlStream(Stream htmlStream, Encoding textEncoding, ImageFormat format)
Parameters
htmlStream
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
format
ImageFormatThe image format
Returns
- byte[]
The created image bytes
GetImageBytesFromHtmlStream(Stream, Encoding, ImageFormat, string)
Converts the HTML string read from a stream to an image having the given format using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStream(Stream, Encoding, string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromHtmlStream(Stream htmlStream, Encoding textEncoding, ImageFormat format, string baseUrl)
Parameters
htmlStream
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
format
ImageFormatThe image format
baseUrl
stringThe base URL
Returns
- byte[]
The created image bytes
GetImageBytesFromHtmlString(string, ImageFormat)
Converts a HTML string to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtml(string, string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromHtmlString(string htmlString, ImageFormat format)
Parameters
htmlString
stringThe HTML string to convert
format
ImageFormatThe image format
Returns
- byte[]
The created image bytes
GetImageBytesFromHtmlString(string, ImageFormat, string)
Converts a HTML string to an image having the given format using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtml(string, string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromHtmlString(string htmlString, ImageFormat format, string baseUrl)
Parameters
htmlString
stringThe HTML string to convert
format
ImageFormatThe image format
baseUrl
stringThe base URL
Returns
- byte[]
The created image bytes
GetImageBytesFromUrl(string, ImageFormat)
Converts an URL to an image having the given image format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrl(string, ImageFormat) method in the future versions
public byte[] GetImageBytesFromUrl(string url, ImageFormat format)
Parameters
url
stringThe URL to convert
format
ImageFormatThe image format
Returns
- byte[]
The created image bytes
GetImageFromHtmlString(string)
Converts a HTML string to an image object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToImageObject(string, string) method in the future versions
public Image GetImageFromHtmlString(string htmlString)
Parameters
htmlString
stringThe HTML string to convert
Returns
- Image
The image object
GetImageFromHtmlString(string, string)
Converts a HTML string to an Image object using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToImageObject(string, string) method in the future versions
public Image GetImageFromHtmlString(string htmlString, string baseUrl)
Parameters
Returns
- Image
The image object
GetImageFromUrl(string)
Converts an URL to an image object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToImageObject(string) method in the future versions
public Image GetImageFromUrl(string url)
Parameters
url
stringThe URL to convert
Returns
- Image
The image object
GetImageTilesFromHtmlString(string)
Converts a HTML string to a set of image objects. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToImageTiles(string, string) method in the future versions
public Image[] GetImageTilesFromHtmlString(string htmlString)
Parameters
htmlString
stringThe HTML string to convert
Returns
- Image[]
The created image objects
GetImageTilesFromHtmlString(string, string)
Converts a HTML string to a set of image objects using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToImageTiles(string, string) method in the future versions
public Image[] GetImageTilesFromHtmlString(string htmlString, string baseUrl)
Parameters
Returns
- Image[]
The created image objects
GetImageTilesFromHtmlString(string, string, string)
Converts a HTML string to a set of image objects using a base URL and an internal links base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToImageTiles(string, string, string) method in the future versions
public Image[] GetImageTilesFromHtmlString(string htmlString, string baseUrl, string internalLinksBaseUrl)
Parameters
htmlString
stringThe HTML string to convert
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe internal links base URL
Returns
- Image[]
The created image objects
GetImageTilesFromUrl(string)
Converts an URL to an array of image objects. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToImageTiles(string) method in the future versions
public Image[] GetImageTilesFromUrl(string url)
Parameters
url
stringThe URL to convert
Returns
- Image[]
The image objects
SaveImageFromHtmlFileToFile(string, ImageFormat, string)
Converts a HTML file to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFileToFile(string, ImageFormat, string) method in the future versions
public void SaveImageFromHtmlFileToFile(string htmlFilePath, ImageFormat format, string outFile)
Parameters
htmlFilePath
stringThe HTML file to convert
format
ImageFormatThe image format
outFile
stringThe output image file
SaveImageFromHtmlStreamToFile(Stream, Encoding, ImageFormat, string)
Converts the HTML string read from a stream to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToFile(Stream, Encoding, string, ImageFormat, string) method in the future versions
public void SaveImageFromHtmlStreamToFile(Stream htmlStream, Encoding textEncoding, ImageFormat format, string outFile)
Parameters
htmlStream
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
format
ImageFormatThe image format
outFile
stringThe output image file
SaveImageFromHtmlStreamToFile(Stream, Encoding, ImageFormat, string, string)
Converts the HTML string read from a stream to an image having the given format using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToFile(Stream, Encoding, string, ImageFormat, string) method in the future versions
public void SaveImageFromHtmlStreamToFile(Stream htmlStream, Encoding textEncoding, ImageFormat format, string outFile, string baseUrl)
Parameters
htmlStream
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
format
ImageFormatThe image format
outFile
stringThe output image file
baseUrl
stringThe base URL
SaveImageFromHtmlStringToFile(string, ImageFormat, string)
Converts a HTML string to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToFile(string, string, ImageFormat, string) method in the future versions
public void SaveImageFromHtmlStringToFile(string htmlString, ImageFormat format, string outFile)
Parameters
htmlString
stringThe HTML string to convert
format
ImageFormatThe image format
outFile
stringThe output image file
SaveImageFromHtmlStringToFile(string, ImageFormat, string, string)
Converts a HTML string to an image having the given format using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToFile(string, string, ImageFormat, string) method in the future versions
public void SaveImageFromHtmlStringToFile(string htmlString, ImageFormat format, string outFile, string baseUrl)
Parameters
htmlString
stringThe HTML string to convert
format
ImageFormatThe image format
outFile
stringThe output image file
baseUrl
stringThe base URL
SaveImageFromUrlToFile(string, ImageFormat, string)
Converts an URL to an image having the given format. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToFile(string, ImageFormat, string) method in the future versions
public void SaveImageFromUrlToFile(string url, ImageFormat format, string outFile)