Table of Contents

Class PdfOptions

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll
public class 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

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

Methods

Equals(PdfOptions)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PdfOptions options)

Parameters

options PdfOptions

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Operators

operator ==(PdfOptions, PdfOptions)

Overriding == operator for PdfOptions.

public static bool operator ==(PdfOptions left, PdfOptions right)

Parameters

left PdfOptions

the value to compare against right.

right PdfOptions

the value to compare against left.

Returns

bool

true if the two instances are equal to the same value.

operator !=(PdfOptions, PdfOptions)

Overriding != operator for PdfOptions.

public static bool operator !=(PdfOptions left, PdfOptions right)

Parameters

left PdfOptions

the value to compare against right.

right PdfOptions

the value to compare against left.

Returns

bool

true if the two instances are not equal to the same value.