class Playwright::Page::PdfOptions
- Playwright::Page::PdfOptions
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
playwright/page.crConstructors
- .new(pull : JSON::PullParser)
- .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)
Instance Method Summary
-
#display_header_footer : Bool | Nil
Display header and footer.
-
#display_header_footer=(display_header_footer : Bool | Nil)
Display header and footer.
-
#footer_template : String | Nil
HTML template for the print footer.
-
#footer_template=(footer_template : String | Nil)
HTML template for the print footer.
-
#format : String | Nil
Paper format.
-
#format=(format : String | Nil)
Paper format.
-
#header_template : String | Nil
HTML template for the print header.
-
#header_template=(header_template : String | Nil)
HTML template for the print header.
-
#height : String | Nil
Paper height, accepts values labeled with units.
-
#height=(height : String | Nil)
Paper height, accepts values labeled with units.
-
#landscape : Bool | Nil
Paper orientation.
-
#landscape=(landscape : Bool | Nil)
Paper orientation.
-
#margin : Margin | Nil
Paper margins, defaults to none.
-
#margin=(margin : Margin | Nil)
Paper margins, defaults to none.
-
#page_ranges : String | Nil
Paper ranges to print, e.g., '1-5, 8, 11-13'.
-
#page_ranges=(page_ranges : String | Nil)
Paper ranges to print, e.g., '1-5, 8, 11-13'.
-
#path : Path | Nil
The file path to save the PDF to.
-
#path=(path : Path | Nil)
The file path to save the PDF to.
- #prefer_css_page_size : Bool | Nil
- #prefer_css_page_size=(prefer_css_page_size : Bool | Nil)
-
#print_background : Bool | Nil
Print background graphics.
-
#print_background=(print_background : Bool | Nil)
Print background graphics.
-
#scale : Int32 | Nil
Scale of the webpage rendering.
-
#scale=(scale : Int32 | Nil)
Scale of the webpage rendering.
-
#width : String | Nil
Paper width, accepts values labeled with units.
-
#width=(width : String | Nil)
Paper width, accepts values labeled with units.
Constructor Detail
Instance Method Detail
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
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
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
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.
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.
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.
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.
Print background graphics. Defaults to false
.
Scale of the webpage rendering. Defaults to 1
. Scale amount must be between 0.1 and 2.
Scale of the webpage rendering. Defaults to 1
. Scale amount must be between 0.1 and 2.