HtmlToImageConvertHtmlToMemoryAsync Method

Asynchronously converts a HTML code to an image in requested format using the base URL to resolve the external references found in HTML. A new instance of HtmlToImage must be created for each call to this method

Definition

Namespace: HiQPdf.Next
Assembly: HiQPdf.Next (in HiQPdf.Next.dll) Version: 18.0.0
C#
public Task<byte[]> ConvertHtmlToMemoryAsync(
	string htmlString,
	string baseUrl,
	ImageType format,
	CancellationToken ct = default
)

Parameters

htmlString  String
The HTML code to convert
baseUrl  String
The base URL that can be used to resolve the relative URLs found in the HTML code. It can be null if there are not relative URLs in the HTML code
format  ImageType
The image format
ct  CancellationToken  (Optional)
A cancellation token that can be used to cancel the asynchronous operation. When cancellation is requested the task returned by this method will complete by throwing OperationCanceledException as soon as possible.

Return Value

TaskByte
The image in requested format

See Also