Search Results for

    Show / Hide Table of Contents

    Class DocxPdfRenderOptions

    Margin values which can be copied from the main document to headers and footers applied to the document

    Inheritance
    System.Object
    DocxPdfRenderOptions
    Namespace: IronPdf
    Assembly: IronPdf.dll
    Syntax
    public class DocxPdfRenderOptions : Object

    Constructors

    DocxPdfRenderOptions()

    Default Constructor. Creates a new instance of DocxPdfRenderOptions with default settings.

    Declaration
    public DocxPdfRenderOptions()

    Fields

    PaperFit

    A html-to-virtual paper setup manager allowing the developer to control how content will be laid out on PDF "paper" pages.

    Include options for: Deafult Chrome Behavior, Zoomed, Responsive CSS3 Layouts, SCale-To-Page & Continuous Feed (e.g. reciept) style PDF page setups.

    Declaration
    public readonly VirtualPaperLayoutManager PaperFit
    Field Value
    Type Description
    VirtualPaperLayoutManager

    Properties

    FirstPageNumber

    Method callback to be invoked whenever a browser JavaScript console message becomes available.

    Declaration
    public int FirstPageNumber { get; set; }
    Property Value
    Type Description
    System.Int32

    ForcePaperSize

    Force page sizes to be exactly what is specified via PaperSize by resizing the page after generating a PDF from HTML

    Useful for bypassing CSS rules which specify paper size

    Declaration
    public bool ForcePaperSize { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Helps correct small errors in page size when rendering HTML to PDF

    GrayScale

    Outputs a black-and-white PDF

    Default value is false.

    Declaration
    public bool GrayScale { get; set; }
    Property Value
    Type Description
    System.Boolean

    InputEncoding

    The input character encoding as a string;

    Default value is Encoding.UTF8.

    Declaration
    public Encoding InputEncoding { get; set; }
    Property Value
    Type Description
    System.Text.Encoding

    MailMergePrintAllInOnePdfDocument

    This option enables the renderer to append all merged documents into one PdfDocument. To print separate PdfDocuments corresponding to each contact, this option should be set to false.

    Declaration
    public bool MailMergePrintAllInOnePdfDocument { get; set; }
    Property Value
    Type Description
    System.Boolean

    MarginBottom

    Bottom Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.

    Default value is 25.

    Declaration
    public double MarginBottom { get; set; }
    Property Value
    Type Description
    System.Double

    MarginLeft

    Left Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.

    Default value is 25.

    Declaration
    public double MarginLeft { get; set; }
    Property Value
    Type Description
    System.Double

    MarginRight

    Right Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.

    Default value is 25.

    Declaration
    public double MarginRight { get; set; }
    Property Value
    Type Description
    System.Double

    MarginTop

    Top Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.

    Default value is 25.

    Declaration
    public double MarginTop { get; set; }
    Property Value
    Type Description
    System.Double

    PaperOrientation

    The PDF paper orientation. E.g. Portrait or Landscape.

    Default value is Portrait.

    Declaration
    public PdfPaperOrientation PaperOrientation { get; set; }
    Property Value
    Type Description
    PdfPaperOrientation

    PaperSize

    Set an output paper size for PDF pages. System.Drawing.Printing.PaperKind.

    Use SetCustomPaperSize(int width, int height) for custom sizes.

    Default value is A4.

    Declaration
    public PdfPaperSize PaperSize { get; set; }
    Property Value
    Type Description
    PdfPaperSize

    PrintHtmlBackgrounds

    Prints background-colors and images from Html.

    Default value is true.

    Declaration
    public bool PrintHtmlBackgrounds { get; set; }
    Property Value
    Type Description
    System.Boolean

    Timeout

    Declaration
    public int Timeout { get; set; }
    Property Value
    Type Description
    System.Int32

    WaitFor

    A wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering.

    Declaration
    public WaitFor WaitFor { get; set; }
    Property Value
    Type Description
    WaitFor
    Remarks

    By default, it will wait for nothing.

    Methods

    SetCustomPaperSizeinCentimeters(Double, Double)

    Set an output paper size for PDF pages. Dimensions are in Centimeters.

    Declaration
    public void SetCustomPaperSizeinCentimeters(double width, double height)
    Parameters
    Type Name Description
    System.Double width

    Custom paper width in cm.

    System.Double height

    Custom paper height in cm.

    SetCustomPaperSizeInInches(Double, Double)

    Set an output paper size for PDF pages. Dimensions are in Inches.

    Declaration
    public void SetCustomPaperSizeInInches(double width, double height)
    Parameters
    Type Name Description
    System.Double width

    Custom paper width in Inches.

    System.Double height

    Custom paper height in Inches.

    SetCustomPaperSizeinMilimeters(Double, Double)

    Set an output paper size for PDF pages. Dimensions are in millimeters.

    Declaration
    public void SetCustomPaperSizeinMilimeters(double width, double height)
    Parameters
    Type Name Description
    System.Double width

    Custom paper width in millimeters.

    System.Double height

    Custom paper height in millimeters.

    SetCustomPaperSizeinPixelsOrPoints(Double, Double, Int32)

    Set an output paper size for PDF pages. Dimensions are in screen Pixels or printer Points.

    Declaration
    public void SetCustomPaperSizeinPixelsOrPoints(double width, double height, int DPI = 96)
    Parameters
    Type Name Description
    System.Double width

    Custom paper width in pixels/points.

    System.Double height

    Custom paper height in pixels/points.

    System.Int32 DPI

    Intended print resolution of the PDF. To be clear PDFs have no fixed DPI/PPI value for rendering. 72 and 96 are common onscreen values. 300 is a comon value used in commercial printing.

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    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.