 |
HtmlToPdfConvertUrl Method |
Renders the web page at the specified URL and returns the result as a PDF document.
Namespace: SelectPdf.UniversalAssembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntaxpublic PdfDocument ConvertUrl(
string url
)
Public Function ConvertUrl (
url As String
) As PdfDocument
Parameters
- url String
- The absolute URL of the web page to convert. Cannot be null or empty.
Return Value
PdfDocument
A
PdfDocument containing the converted content. The caller is responsible
for saving and closing the returned document.
Exceptions| Exception | Condition |
|---|
| HtmlToPdfException |
Thrown when url is null or empty, or when the conversion fails
(for example an unreachable host, a navigation timeout or a proxy error).
|
ExampleHtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl("https://www.google.com");
doc.Save("google.pdf");
doc.Close();Dim converter As New HtmlToPdf()
Dim doc As PdfDocument = converter.ConvertUrl("https://www.google.com")
doc.Save("google.pdf")
doc.Close()
See Also