Class AdaptivePdfRenderer
A class allowing a developer to control rendering of HTML to PDFs using WebKit and Chrome engines from a single class instance.
Default behavior is to detect and select an installed browser engine.
Inheritance
Inherited Members
Namespace: IronPdf.Rendering
Assembly: IronPdf.dll
Syntax
public class AdaptivePdfRenderer : PdfRenderProxy<AdaptivePdfRenderOptions, AdaptiveHttpLoginCredentials>, IPdfRenderProxy<AdaptivePdfRenderOptions, AdaptiveHttpLoginCredentials>, IRenderer
Constructors
AdaptivePdfRenderer()
Creates a new instance of AdaptivePdfRenderer.
Declaration
public AdaptivePdfRenderer()
Properties
ActiveRenderingEngine
Informs the developer which PdfRenderingEngine is active at runtime. This will differ from RenderingEngine if this propoerty is set to default.
Declaration
public PdfRenderingEngine ActiveRenderingEngine { get; }
Property Value
Type | Description |
---|---|
PdfRenderingEngine |
Methods
StaticRenderHtmlAsPdf(String, AdaptivePdfRenderOptions)
Creates a PDF file from an Html string, and returns it as a PdfDocument.
Static variant of RenderHtmlAsPdf
Declaration
public static PdfDocument StaticRenderHtmlAsPdf(string Html, AdaptivePdfRenderOptions Options)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderHtmlAsPdf(String, String, AdaptivePdfRenderOptions, String)
Creates a PDF file from an Html string, and returns it as a PdfDocument.
Static variant of RenderHtmlAsPdf
Declaration
public static PdfDocument StaticRenderHtmlAsPdf(string Html, string BaseUrlOrPath, AdaptivePdfRenderOptions Options = null, string Proxy = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.String | BaseUrlOrPath | Optional. Setting the BaseUrlOrPath property gives the relative file path or URL context for hyper-links, images, CSS and JavaScript files. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
System.String | Proxy | Optional. Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderHtmlAsPdf(String, Uri, AdaptivePdfRenderOptions, String)
Creates a PDF file from an Html string, and returns it as a PdfDocument.
Static variant of RenderHtmlAsPdf
Declaration
public static PdfDocument StaticRenderHtmlAsPdf(string Html, Uri BaseUrl = null, AdaptivePdfRenderOptions Options = null, string Proxy = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.Uri | BaseUrl | Optional. Setting the BaseURL property gives the relative file path or URL context for hyper-links, images, CSS and JavaScript files. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
System.String | Proxy | Optional. Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderHtmlAsPdfAsync(String, Uri, AdaptivePdfRenderOptions)
Creates a PDF file from an Html string, and returns it as a PdfDocument.
Static Async variant of RenderHtmlAsPdf
Declaration
public static Task<PdfDocument> StaticRenderHtmlAsPdfAsync(string Html, Uri BaseUrl = null, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | Html | The Html to be rendered as a PDF. |
System.Uri | BaseUrl | Optional. Setting the BaseURL property gives the relative file path or URL context for hyper-links, images, CSS and JavaScript files. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> |
StaticRenderHTMLFileAsPdf(String, AdaptivePdfRenderOptions)
Creates a PDF file from a local Html file, and returns it as a PdfDocument.
Static variant of RenderHTMLFileAsPdf
Declaration
public static PdfDocument StaticRenderHTMLFileAsPdf(string FilePath, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Html to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderHTMLFileAsPdfAsync(String, AdaptivePdfRenderOptions)
Creates a PDF file from a local Html file, and returns it as a PdfDocument.
Static Async variant of RenderHTMLFileAsPdf
Declaration
public static Task<PdfDocument> StaticRenderHTMLFileAsPdfAsync(string FilePath, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Html to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> |
StaticRenderUrlAsPdf(String, AdaptivePdfRenderOptions)
Creates a PDF file from a URL or local file path and returns it as a PdfDocument.
Static variant of RenderUrlAsPdf
Declaration
public static PdfDocument StaticRenderUrlAsPdf(string UrlOrPath, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | UrlOrPath | An absolute (fully formed) Uri or file path. Points to the Html document to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderUrlAsPdf(Uri, AdaptivePdfRenderOptions)
Creates a PDF file from a URL or local file path and returns it as a PdfDocument.
Static variant of RenderUrlAsPdf
Declaration
public static PdfDocument StaticRenderUrlAsPdf(Uri Url, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | Url | An absolute (fully formed) Uri. Points to the Html document to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
PdfDocument |
StaticRenderUrlAsPdfAsync(String, AdaptivePdfRenderOptions)
Creates a PDF file from a URL or local file path and returns it as a PdfDocument.
Static Async variant of RenderUrlAsPdf
Declaration
public static Task<PdfDocument> StaticRenderUrlAsPdfAsync(string UrlOrPath, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | UrlOrPath | An absolute (fully formed) Uri or file path. Points to the Html document to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> |
StaticRenderUrlAsPdfAsync(Uri, AdaptivePdfRenderOptions)
Creates a PDF file from a URL or local file path and returns it as a PdfDocument.
Static Async variant of RenderUrlAsPdf
Declaration
public static Task<PdfDocument> StaticRenderUrlAsPdfAsync(Uri Url, AdaptivePdfRenderOptions Options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | Url | An absolute (fully formed) Uri. Points to the Html document to be rendered as a PDF. |
AdaptivePdfRenderOptions | Options | Optional. Configure the renderer by passing an instance of AdaptivePdfRenderOptions |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PdfDocument> |