Click or drag to resize
Pdf Library for .NET

HtmlToImageConvertHtmlString Method (String, String)

Gets an Image object from the specified html string.

Namespace:  SelectPdf
Assembly:  Select.Pdf (in Select.Pdf.dll) Version: 20.2
Syntax
public Image ConvertHtmlString(
	string htmlString,
	string baseUrl
)

Parameters

htmlString
Type: SystemString
The html string to be converted to image.
baseUrl
Type: SystemString
This parameter allows the converter to resolve relative urls. Basically, baseUrl + relative image/css url = full absolute url.

Return Value

Type: Image
The rendered Image object.
Remarks
The baseUrl parameter allows the converter to determine the full absolute urls from relative urls for images and css files appearing in the html string.

The Image object can be further manipulated to have the format changed, saved to disk, etc.

See Also