Table of Contents

Class PdfOptions

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll
public record PdfOptions : IEquatable<PdfOptions>
Inheritance
PdfOptions
Implements

Constructors

PdfOptions()

Initializes a new instance of the PdfOptions class.

public PdfOptions()

Properties

DisplayHeaderFooter

Display header and footer. Defaults to false.

public bool DisplayHeaderFooter { get; set; }

Property Value

bool

FooterTemplate

HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them: date - formatted print date title - document title url - document location pageNumber - current page number totalPages - total pages in the document.

public string FooterTemplate { get; set; }

Property Value

string

Format

Paper format. If set, takes priority over Width and Height.

public PaperFormat Format { get; set; }

Property Value

PaperFormat

HeaderTemplate

HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: date - formatted print date title - document title url - document location pageNumber - current page number totalPages - total pages in the document.

public string HeaderTemplate { get; set; }

Property Value

string

Height

Paper height, accepts values labeled with units.

public object Height { get; set; }

Property Value

object

Landscape

Paper orientation.. Defaults to false.

public bool Landscape { get; set; }

Property Value

bool

MarginOptions

Paper margins, defaults to none.

public MarginOptions MarginOptions { get; set; }

Property Value

MarginOptions

OmitBackground

Hides default white background and allows generating pdfs with transparency.

public bool OmitBackground { get; set; }

Property Value

bool

Outline

Generate document outline.

public bool Outline { get; set; }

Property Value

bool

Remarks

If this is enabled the PDF will also be tagged (accessible) Currently only works in old Headless (headless = true).

PageRanges

Paper ranges to print, e.g., 1-5, 8, 11-13. Defaults to the empty string, which means print all pages.

public string PageRanges { get; set; }

Property Value

string

PreferCSSPageSize

Give any CSS @page size declared in the page priority over what is declared in width and height or format options. Defaults to false, which will scale the content to fit the paper size.

public bool PreferCSSPageSize { get; set; }

Property Value

bool

PrintBackground

Print background graphics. Defaults to false.

public bool PrintBackground { get; set; }

Property Value

bool

Scale

Scale of the webpage rendering. Defaults to 1. Scale amount must be between 0.1 and 2.

public decimal Scale { get; set; }

Property Value

decimal

Tagged

Generate tagged (accessible) PDF.

public bool Tagged { get; set; }

Property Value

bool

Width

Paper width, accepts values labeled with units.

public object Width { get; set; }

Property Value

object