 |
HtmlToImageConvertUrlAsync(String) Method |
Asynchronously converts the web page at the specified url to an image in
ImageFormat (PNG by default).
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntaxpublic Task<byte[]> ConvertUrlAsync(
string url
)
Public Function ConvertUrlAsync (
url As String
) As Task(Of Byte())
Parameters
- url String
- The absolute url of the web page to render.
Return Value
TaskByteA task that completes with the rendered image, encoded in
ImageFormat.
Exceptions| Exception | Condition |
|---|
| HtmlToPdfException | The task faults with this exception when url is null or empty, or the conversion fails. |
Remarks
The conversion produces the same image as
ConvertUrl(String). While the page loads and
renders, no thread is held waiting for it.
ExampleSelectPdf.Universal.HtmlToImage converter = new SelectPdf.Universal.HtmlToImage();
byte[] png = await converter.ConvertUrlAsync("https://selectpdf.com");Dim converter As New SelectPdf.Universal.HtmlToImage()
Dim png As Byte() = Await converter.ConvertUrlAsync("https://selectpdf.com")
See Also