HtmlToPdfStaticRenderHtmlAsPdfAsync Method

Static asynchronous method that renders an HTML file as PDF.

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 2020.10.3
Syntax
public static Task<PdfDocument> StaticRenderHtmlAsPdfAsync(
	string Html,
	string BaseUrlOrPath = null,
	PdfPrintOptions PrintOptions = null
)

Parameters

Html
Type: SystemString
The Html to be rendered as a PDF.
BaseUrlOrPath (Optional)
Type: SystemString
Setting the BaseUrlOrPath property gives the relative context for hyper-links, images, CSS and JavaScript files.
PrintOptions (Optional)
Type: IronPdfPdfPrintOptions
Sets PDF output options such as paper-size, DPI, headers and footers using an instance of the IronPdf.PdfPrintOptions Class.

Return Value

Type: TaskPdfDocument
Task of type PdfDocument
See Also
Install with Nuget