class

Playwright::Page::PdfOptions

Inherits JSON::Serializable / Reference / Object

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

format

Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.

Source
format=(format : String | Nil)

Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.

Source
header_template

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
Source
header_template=(header_template : String | Nil)

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
Source
height

Paper height, accepts values labeled with units.

Source
height=(height : String | Nil)

Paper height, accepts values labeled with units.

Source
landscape

Paper orientation. Defaults to false.

Source
landscape=(landscape : Bool | Nil)

Paper orientation. Defaults to false.

Source
margin

Paper margins, defaults to none.

Source
margin=(margin : Margin | Nil)

Paper margins, defaults to none.

Source
page_ranges

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

Source
page_ranges=(page_ranges : String | Nil)

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

Source
path

The file path to save the PDF to. If path is a relative path, then it is resolved relative to the current working directory. If no path is provided, the PDF won't be saved to the disk.

Source
path=(path : Path | Nil)

The file path to save the PDF to. If path is a relative path, then it is resolved relative to the current working directory. If no path is provided, the PDF won't be saved to the disk.

Source
prefer_css_page_size

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.

Source
prefer_css_page_size=(prefer_css_page_size : Bool | Nil)

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.

Source
scale

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

Source
scale=(scale : Int32 | Nil)

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

Source
width

Paper width, accepts values labeled with units.

Source
width=(width : String | Nil)

Paper width, accepts values labeled with units.

Source

Nested types