Class PdfOptions
- Namespace
- PuppeteerSharp
- Assembly
- PuppeteerSharp.dll
Options to be used in PdfAsync(string, PdfOptions), PdfStreamAsync(PdfOptions) and PdfDataAsync(PdfOptions).
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
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
Format
public PaperFormat Format { get; set; }
Property Value
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
Height
Paper height, accepts values labeled with units.
public object Height { get; set; }
Property Value
Landscape
Paper orientation.. Defaults to false
.
public bool Landscape { get; set; }
Property Value
MarginOptions
Paper margins, defaults to none.
public MarginOptions MarginOptions { get; set; }
Property Value
OmitBackground
Hides default white background and allows generating pdfs with transparency.
public bool OmitBackground { get; set; }
Property Value
Outline
Generate document outline.
public bool Outline { get; set; }
Property Value
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
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
PrintBackground
Print background graphics. Defaults to false
.
public bool PrintBackground { get; set; }
Property Value
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
Tagged
Generate tagged (accessible) PDF.
public bool Tagged { get; set; }
Property Value
Width
Paper width, accepts values labeled with units.
public object Width { get; set; }