Click or drag to resize
Pdf Library for .NET

HtmlToPdfConvertUrl Method

Renders the web page at the specified URL and returns the result as a PDF document.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public PdfDocument ConvertUrl(
	string url
)

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
ExceptionCondition
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).
Example
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl("https://www.google.com");
doc.Save("google.pdf");
doc.Close();
See Also