Search Results for

    Show / Hide Table of Contents

    Class BasePdfRenderer

    An abstract generic class

    Inheritance
    System.Object
    BasePdfRenderer
    ChromePdfRenderer
    Implements
    IPdfRenderer
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ToString()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: IronPdf.Rendering.Abstractions
    Assembly: IronPdf.dll
    Syntax
    public abstract class BasePdfRenderer : IPdfRenderer
    Remarks

    Implements functionality and program flow details which are common to all renderers

    Properties

    LoginCredentials

    Http login credentials

    Declaration
    public ChromeHttpLoginCredentials LoginCredentials { get; set; }
    Property Value
    Type Description
    ChromeHttpLoginCredentials

    RenderingOptions

    Html to Pdf rendering options

    Declaration
    public ChromePdfRenderOptions RenderingOptions { get; set; }
    Property Value
    Type Description
    ChromePdfRenderOptions

    Methods

    RenderHtmlAsPdf(String, String, String)

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

    IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. If your output PDF does not look as expected:
    - Validate your HTML using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/
    - To debug HTML, Save your HTML string to a file and view in Chrome web browser's print preview which will work almost exactly as IronPDF.
    - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/

    Declaration
    public PdfDocument RenderHtmlAsPdf(string Html, string BaseUrlOrPath, string Proxy = null)
    Parameters
    Type Name Description
    System.String Html

    The Html to be rendered as a PDF.

    System.String BaseUrlOrPath

    Optional. Setting the BaseUBaseUrlOrPathRL property gives the relative file path or URL context for hyper-links, images, CSS and JavaScript files.

    System.String Proxy

    Optional. Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderHtmlAsPdf(String, Uri, String)

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

    IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. If your output PDF does not look as expected:
    - Validate your HTML using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/
    - To debug HTML, Save your HTML string to a file and view in Chrome web browser's print preview which will work almost exactly as IronPDF.
    - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/

    Declaration
    public PdfDocument RenderHtmlAsPdf(string Html, Uri BaseUrl = 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.

    System.String Proxy

    Optional. Specifies an Http proxy server. Use the pattern: http(s)://user-name:password@host:port

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderHtmlAsPdfAsync(String, Uri)

    Asynchronously creates a PDF file from a URL or local file path and returns it as a PdfDocument.

    Asynchronous variant of RenderHtmlAsPdf(String, Uri, String)

    Declaration
    public Task<PdfDocument> RenderHtmlAsPdfAsync(string Html, Uri BaseUrl = 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 point to a local directory or a remote URL.

    Returns
    Type Description
    System.Threading.Tasks.Task<PdfDocument>

    A PdfDocument

    RenderHtmlFileAsPdf(String)

    Creates a PDF file from a local Html file, and returns it as a PdfDocument.

    IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. If your output PDF does not look as expected:
    - Validate your HTML file using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/
    - To debug HTML, view the file in Chrome web browser's print preview which will work almost exactly as IronPDF.
    - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/

    Declaration
    public PdfDocument RenderHtmlFileAsPdf(string FilePath)
    Parameters
    Type Name Description
    System.String FilePath

    Path to an Html to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderHtmlFileAsPdfAsync(String)

    Asynchronously creates a PDF file from a local Html file, and returns it as a PdfDocument.

    Asynchronous variant of RenderHtmlFileAsPdf(String)

    Declaration
    public Task<PdfDocument> RenderHtmlFileAsPdfAsync(string FilePath)
    Parameters
    Type Name Description
    System.String FilePath

    Path to an Html to be rendered as a PDF.

    Returns
    Type Description
    System.Threading.Tasks.Task<PdfDocument>

    A PdfDocument

    RenderMarkdownFileAsPdf(String)

    Creates a PDF file from a Markdown file and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderMarkdownFileAsPdf(string FilePath)
    Parameters
    Type Name Description
    System.String FilePath

    Path to an Markdown file to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderMarkdownStringAsPdf(String)

    Creates a PDF file from an Markdown string format and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderMarkdownStringAsPdf(string markdownString)
    Parameters
    Type Name Description
    System.String markdownString

    Markdown string to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderRtfFileAsPdf(String)

    Creates a PDF file from a RTF (rich text format) file and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderRtfFileAsPdf(string FilePath)
    Parameters
    Type Name Description
    System.String FilePath

    Path to an RTF file to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderRtfStringAsPdf(String)

    Creates a PDF file from an RTF (rich text format) string and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderRtfStringAsPdf(string RtfString)
    Parameters
    Type Name Description
    System.String RtfString

    RTF string to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderUrlAsPdf(String)

    Creates a PDF file from a URL or local file path and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderUrlAsPdf(string UrlOrPath)
    Parameters
    Type Name Description
    System.String UrlOrPath

    Path to an Html to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderUrlAsPdf(Uri)

    Creates a PDF file from a URL or local file path and returns it as a PdfDocument.

    Declaration
    public PdfDocument RenderUrlAsPdf(Uri Url)
    Parameters
    Type Name Description
    System.Uri Url

    An absolute (fully formed) Uri. Points to the Html document to be rendered as a PDF.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    RenderUrlAsPdfAsync(String)

    Asynchronously creates a PDF file from a URL or local file path and returns it as a PdfDocument.

    Asynchronous variant of RenderUrlAsPdf(String)

    Declaration
    public Task<PdfDocument> RenderUrlAsPdfAsync(string UrlOrPath)
    Parameters
    Type Name Description
    System.String UrlOrPath

    Path or URL to an Html document to be rendered as a PDF.

    Returns
    Type Description
    System.Threading.Tasks.Task<PdfDocument>

    A PdfDocument

    RenderUrlAsPdfAsync(Uri)

    Asynchronously creates a PDF file from a URL or local file path and returns it as a PdfDocument.

    Asynchronous variant of RenderUrlAsPdf(Uri)

    Declaration
    public Task<PdfDocument> RenderUrlAsPdfAsync(Uri Url)
    Parameters
    Type Name Description
    System.Uri Url

    An absolute (fully formed) Uri. Points to the Html document to be rendered as a PDF.

    Returns
    Type Description
    System.Threading.Tasks.Task<PdfDocument>

    A PdfDocument

    RenderZipFileAsPdf(String, String)

    Creates a PDF file from a local Zip file, and returns it as a PdfDocument.

    IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. If your output PDF does not look as expected:
    - Validate your HTML file using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/
    - To debug HTML, view the file in Chrome web browser's print preview which will work almost exactly as IronPDF.
    - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/

    Declaration
    public PdfDocument RenderZipFileAsPdf(string FilePath, string MainFile)
    Parameters
    Type Name Description
    System.String FilePath

    Path to an Zip to be rendered as a PDF.

    System.String MainFile

    Name of the primary HTML file.

    Returns
    Type Description
    PdfDocument

    A PdfDocument

    Implements

    IPdfRenderer

    Inherited members

    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ToString()
    System.Object.ReferenceEquals(System.Object, System.Object)
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Free 30-Day Trial Key
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.