Click or drag to resize

ImgConverterSaveImageFromUrlToFileAsync Method

Converts the specified URL into an image asynchronously and saves it to the specified file in the specified format.

Namespace: ExpertPdf.Anywhere.HtmlToPdf
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public Task SaveImageFromUrlToFileAsync(
	string url,
	ImageFormat format,
	string outFile,
	CancellationToken cancellationToken = default
)

Parameters

url  String
The URL of the web page to be converted. The URL can be also the full path of a HTML file from the local file system.
format  ImageFormat
The image format.
outFile  String
The full path of the image file to create.
cancellationToken  CancellationToken  (Optional)
A token that cancels the conversion.

Return Value

Task
A task that completes when the image file is written.
Remarks
See GetImageBytesFromUrlAsync(String, ImageFormat, CancellationToken) for how the conversion runs and how cancellation works. The file is written only by a conversion that completes before it is canceled.
See Also