Click or drag to resize
Pdf Library for .NET

HtmlToImageConvertHtmlString(String, String) Method

Converts the specified HTML string to an image in ImageFormat (PNG by default), resolving relative urls against the base url.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public byte[] ConvertHtmlString(
	string htmlString,
	string baseUrl
)

Parameters

htmlString  String
The HTML markup to render.
baseUrl  String
The base url used to resolve relative resource references (images, CSS) in the markup.

Return Value

Byte
The rendered image, encoded in ImageFormat.
Exceptions
ExceptionCondition
HtmlToPdfExceptionThrown when htmlString is null, or the conversion fails.
See Also