HtmlToImageConvertUrlToFileAsync Method

Asynchronously converts the HTML document from the given URL to an image file in requested format. 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 ConvertUrlToFileAsync(
	string url,
	ImageType format,
	string outFile,
	CancellationToken ct = default
)

Parameters

url  String
The URL of the document to convert. The full path of a HTML file in the local file system prefixed by file:// is accepted as an URL
format  ImageType
The image format
outFile  String
The output image file path
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

Task
A task that represents the asynchronous operation

See Also