Click or drag to resize

HtmlToPdfRenderHtmlAsPdf Method (String, String, String)

Creates a PDF file from an Html string, and returns it as an IronPdf.PdfDocument

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 4.4.2.27556 (4.4.4.0)
Syntax
public PdfDocument RenderHtmlAsPdf(
	string Html,
	string BaseUrlOrPath,
	string Proxy = null
)

Parameters

Html
Type: SystemString
The Html to be rendered as a PDF.
BaseUrlOrPath
Type: SystemString
Setting the BaseUrlOrPath property gives the relative context for hyper-links, images, CSS and JavaScript files.
Proxy (Optional)
Type: SystemString
Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port

Return Value

Type: PdfDocument
A PdfDocument
Examples
HtmlToPdf myHtmlToPdf = new IronPdf.HtmlToPdf();
            myHtmlToPdf.RenderHtmlAsPdf("<p>html</p>").SaveAs(@"Path\File.Pdf");
See Also