Class WebKitPdfRenderer
IronPdf.WebKitPdfRenderer allows any web page or Html 'snippet' to be turned into a PDF document using an embedded WebKit browser.
As of 2021 Iron Software reccomend ChromePdfRenderer as our best PDF Renderer and a drop-in replacement for this class.
Inheritance
Inherited Members
Namespace: IronPdf
Assembly: IronPdf.dll
Syntax
public class WebKitPdfRenderer : PdfRenderProxy<WebKitPdfRenderOptions, WebKitHttpLoginCredentials>, IPdfRenderProxy<WebKitPdfRenderOptions, WebKitHttpLoginCredentials>, IRenderer
Constructors
WebKitPdfRenderer()
Create a new WebKit Html to PDF renderer.
Declaration
public WebKitPdfRenderer()
Methods
StaticRenderHtmlAsPdf(String, String, WebKitPdfRenderOptions, String)
Creates a PDF file from an Html string, and returns it as an PdfDocument object which can be edited and saved to disk or served on a website.
Static version of the RenderHtmlAsPdf method.
Declaration
public static PdfDocument StaticRenderHtmlAsPdf(string Html, string BaseUrlOrPath, WebKitPdfRenderOptions Options = null, string Proxy = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.String | BaseUrlOrPath | Setting the BaseURL property gives the relative context for hyper-links, images, CSS and JavaScript files. May be a remote URL or local file path. |
WebKitPdfRenderOptions | Options | An instance of WebKitPdfRenderOptions that allows configuration of WebKit "HTML to PDF" rendering parameters. |
System.String | Proxy | Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port |
Returns
Type | Description |
---|---|
PdfDocument | A PdfDocument with the Html rendered as its contents. |
StaticRenderHtmlAsPdf(String, Uri, WebKitPdfRenderOptions, String)
Creates a PDF file from an Html string, and returns it as an PdfDocument object which can be edited and saved to disk or served on a website.
Static version of the RenderHtmlAsPdf method.
Declaration
public static PdfDocument StaticRenderHtmlAsPdf(string Html, Uri BaseUrl = null, WebKitPdfRenderOptions Options = null, string Proxy = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.Uri | BaseUrl | Setting the BaseURL property gives the relative context for hyper-links, images, CSS and JavaScript files. May be a remote URL or local file path. |
WebKitPdfRenderOptions | Options | An instance of WebKitPdfRenderOptions that allows configuration of WebKit "HTML to PDF" rendering parameters. |
System.String | Proxy | Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port |
Returns
Type | Description |
---|---|
PdfDocument | A PdfDocument with the Html rendered as its contents. |
StaticRenderHtmlAsPdfAsync(String, Uri, WebKitPdfRenderOptions)
Creates a PDF file from an Html string, and returns it as an PdfDocument object which can be edited and saved to disk or served on a website.
Static Async version of the RenderHtmlAsPdf method.
Declaration
public static Task<PdfDocument> StaticRenderHtmlAsPdfAsync(string Html, Uri BaseUrl = null, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.Uri | BaseUrl | Setting the BaseURL property gives the relative context for hyper-links, images, CSS and JavaScript files. May be a remote URL or local file path. |
WebKitPdfRenderOptions | Options | An instance of WebKitPdfRenderOptions that allows configuration of WebKit "HTML to PDF" rendering parameters. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> | A PdfDocument with the Html rendered as its contents. |
StaticRenderHTMLFileAsPdf(String, WebKitPdfRenderOptions)
Renders an HTML file as a PDF file. Returns a PdfDocument object which may be edited and saved to disk or served on a website.
Static version of the RenderHTMLFileAsPdf method.
Declaration
public static PdfDocument StaticRenderHTMLFileAsPdf(string FilePath, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Html file. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
PdfDocument | A PdfDocument with the Html file rendered as its contents.. |
StaticRenderHTMLFileAsPdfAsync(String, WebKitPdfRenderOptions)
Renders an HTML file as a PDF file. Returns a PdfDocument object which may be edited and saved to disk or served on a website.
Static Async version of the RenderHTMLFileAsPdf method.
Declaration
public static Task<PdfDocument> StaticRenderHTMLFileAsPdfAsync(string FilePath, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Html file. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> | A PdfDocument with the Html file rendered as its contents. |
StaticRenderUrlAsPdf(String, WebKitPdfRenderOptions)
Renders all Html and assets at a given Url into a PDF file using IronPdf's embedded WebKit browser as the rendering engine.
Static version of the RenderUrlAsPdf method.
Declaration
public static PdfDocument StaticRenderUrlAsPdf(string UrlOrPath, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | UrlOrPath | An absolute Url. Points to the Html document to be rendered as a PDF. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
PdfDocument | A PdfDocument with the Url rendered as its contents. |
StaticRenderUrlAsPdf(Uri, WebKitPdfRenderOptions)
Renders all Html and assets at a given Url into a PDF file using IronPdf's embedded WebKit browser as the rendering engine.
Static version of the RenderUrlAsPdf method.
Declaration
public static PdfDocument StaticRenderUrlAsPdf(Uri Url, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | Url | An absolute Uri. Points to the Html document or local file file to be rendered as a PDF. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
PdfDocument | A PdfDocument with the Url rendered as its contents. |
StaticRenderUrlAsPdfAsync(String, WebKitPdfRenderOptions)
Renders all Html and assets at a given Url into a PDF file using IronPdf's embedded WebKit browser as the rendering engine.
Static Async version of the RenderUrlAsPdf method.
Declaration
public static Task<PdfDocument> StaticRenderUrlAsPdfAsync(string UrlOrPath, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | UrlOrPath | An absolute Url. Points to the Html document or local file to be rendered as a PDF. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> | A PdfDocument with the Url rendered as its contents. |
StaticRenderUrlAsPdfAsync(Uri, WebKitPdfRenderOptions)
Renders all Html and assets at a given Url into a PDF file using IronPdf's embedded WebKit browser as the rendering engine.
Static Async version of the RenderUrlAsPdf method.
Declaration
public static Task<PdfDocument> StaticRenderUrlAsPdfAsync(Uri Url, WebKitPdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | Url | An absolute Uri. Points to the Html document or local file file to be rendered as a PDF. |
WebKitPdfRenderOptions | Options | Optional print options and settings as an instance of WebKitPdfRenderOptions. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> | A PdfDocument with the Url rendered as its contents. |