Click or drag to resize

ImgConverterGetImageBytesFromHtmlStringAsync(String, ImageFormat, CancellationToken) Method

Converts the specified HTML string into an image asynchronously and returns the image as an array of bytes in the specified format.

Namespace: ExpertPdf.Anywhere.HtmlToPdf
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public Task<byte[]> GetImageBytesFromHtmlStringAsync(
	string htmlString,
	ImageFormat format,
	CancellationToken cancellationToken = default
)

Parameters

htmlString  String
The HTML string to be converted.
format  ImageFormat
The image format.
cancellationToken  CancellationToken  (Optional)
A token that cancels the conversion.

Return Value

TaskByte
A task whose result is the image bytes.
Remarks
See GetImageBytesFromUrlAsync(String, ImageFormat, CancellationToken) for how the conversion runs and how cancellation works.
See Also