Click or drag to resize

PdfPrintOptions Class

PDF output options for IronPdf. Specifies options such as Paper-Size, DPI, Headers and Footers.
Inheritance Hierarchy
SystemObject
  IronPdfPdfPrintOptions

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 2019.8.7.20671 (2019.8.7.2)
Syntax
public class PdfPrintOptions

The PdfPrintOptions type exposes the following members.

Constructors
  NameDescription
Public methodPdfPrintOptions
Initializes a new instance of the PdfPrintOptions class
Top
Properties
  NameDescription
Public propertyViewPortHeight
Defines a virtual screen height used to render HTML to PDF in IronPdf. Measured in pixels.

Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many websites.

Public propertyViewPortWidth
Defines a virtual screen width used to render HTML to PDF in IronPdf. Measured in pixels.

Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many website

Top
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodSetCustomPaperSize
Sets the size of the custom paper. Depreciated.
Public methodSetCustomPaperSizeInInches
Set an output paper size for PDF pages. Dimensions are in Inches.
Public methodSetCustomPaperSizeinMilimeters
Set an output paper size for PDF pages. Dimensions are in millimeters.
Public methodToString (Inherited from Object.)
Top
Fields
  NameDescription
Public fieldCreatePdfFormsFromHtml
Turns all Html forms elements into editable PDF forms.
Public fieldCssMediaType
Enables Media="screen" CSS Styles and StyleSheets

Note: By setting AllowScreenCss=false, IronPdf prints using CSS for media="print" only.

Public fieldCustomCssUrl
Allows a custom CSS style-sheet to be applied to Html before rendering. May be a local file path, or remote url.
Public fieldDPI
Printing output DPI. 300 is standard for most print jobs. Higher resolutions produce clearer images and text, but also larger PDF files.
Public fieldEnableJavaScript
Enables JavaScript and Json to be executed before the page is rendered. Ideal for printing from Ajax / Angular Applications.

Also see RenderDelay

Public fieldFirstPageNumber
First page number to be used in PDF headers and footers.
Public fieldFitToPaperWidth
Where possible, shrinks the PDF content to 1 page of paper width.

This applies when the PDF content is too wide for the given PaperSize (given that 1 HTML pixel = 1 DPI).

Public fieldFooter
Sets the footer content for every PDF page as Html or String. Supports 'mail-merge'.
Public fieldGrayScale
Outputs a black-and-white PDF
Public fieldHeader
Sets the header content for every PDF page as Html or String. Supports 'mail-merge'.
Public fieldInputEncoding
The input character encoding as a string;
Public fieldJpegQuality
Quality of any image that must be re-sampled. 0-100
Public fieldMarginBottom
Paper margin in millimeters. Set to zero for border-less and commercial printing applications.
Public fieldMarginLeft
Paper margin in millimeters. Set to zero for border-less and commercial printing applications.
Public fieldMarginRight
Paper margin in millimeters. Set to zero for border-less and commercial printing applications.
Public fieldMarginTop
Paper margin in millimeters. Set to zero for border-less and commercial printing applications.
Public fieldPaperOrientation
The PDF paper orientation.
Public fieldPaperSize
Set an output paper size for PDF pages. System.Drawing.Printing.PaperKind.

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

Public fieldPrintHtmlBackgrounds
Prints background-colors and images from Html
Public fieldRenderDelay
Milliseconds to wait after Html is rendered before printing. This can use useful when considering the rendering of JavaScript, Ajax or animations.
Public fieldTitle
PDF Document Name and Title meta-data. Not required.
Public fieldZoom
The zoom level in %. Enlarges the rendering size of Html documents.
Top
See Also