class Playwright::Page::PdfOptions

Included Modules

Defined in:

playwright/page.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(path : Path | Nil = nil, scale : Int32 | Nil = nil, display_header_footer : Bool | Nil = nil, header_template : Nil | String = nil, footer_template : Nil | String = nil, print_background : Bool | Nil = nil, landscape : Bool | Nil = nil, page_ranges : Nil | String = nil, format : Nil | String = nil, width : Nil | String = nil, height : Nil | String = nil, margin : Nil | Playwright::Page::PdfOptions::Margin = nil, prefer_css_page_size : Bool | Nil = nil) #

[View source]

Instance Method Detail

def display_header_footer : Bool | Nil #

Display header and footer. Defaults to false.


[View source]
def display_header_footer=(display_header_footer : Bool | Nil) #

Display header and footer. Defaults to false.


[View source]
def footer_template : String | Nil #

HTML template for the print footer. Should use the same format as the headerTemplate.


[View source]
def footer_template=(footer_template : String | Nil) #

HTML template for the print footer. Should use the same format as the headerTemplate.


[View source]
def format : String | Nil #

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


[View source]
def format=(format : String | Nil) #

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


[View source]
def 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

[View source]
def 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

[View source]
def height : String | Nil #

Paper height, accepts values labeled with units.


[View source]
def height=(height : String | Nil) #

Paper height, accepts values labeled with units.


[View source]
def landscape : Bool | Nil #

Paper orientation. Defaults to false.


[View source]
def landscape=(landscape : Bool | Nil) #

Paper orientation. Defaults to false.


[View source]
def margin : Margin | Nil #

Paper margins, defaults to none.


[View source]
def margin=(margin : Margin | Nil) #

Paper margins, defaults to none.


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def print_background : Bool | Nil #

Print background graphics. Defaults to false.


[View source]
def print_background=(print_background : Bool | Nil) #

Print background graphics. Defaults to false.


[View source]
def scale : Int32 | Nil #

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


[View source]
def scale=(scale : Int32 | Nil) #

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


[View source]
def width : String | Nil #

Paper width, accepts values labeled with units.


[View source]
def width=(width : String | Nil) #

Paper width, accepts values labeled with units.


[View source]