Modifier and Type | Field and Description |
---|---|
Boolean |
displayHeaderFooter
Display header and footer.
|
String |
footerTemplate
HTML template for the print footer.
|
String |
format
Paper format.
|
String |
headerTemplate
HTML template for the print header.
|
String |
height
Paper height, accepts values labeled with units.
|
Boolean |
landscape
Paper orientation.
|
Margin |
margin
Paper margins, defaults to none.
|
String |
pageRanges
Paper ranges to print, e.g., '1-5, 8, 11-13'.
|
Path |
path
The file path to save the PDF to.
|
Boolean |
preferCSSPageSize
Give any CSS
@page size declared in the page priority over what is declared in width and height or format
options. |
Boolean |
printBackground
Print background graphics.
|
Double |
scale
Scale of the webpage rendering.
|
String |
width
Paper width, accepts values labeled with units.
|
Constructor and Description |
---|
PdfOptions() |
Modifier and Type | Method and Description |
---|---|
Page.PdfOptions |
setDisplayHeaderFooter(boolean displayHeaderFooter)
Display header and footer.
|
Page.PdfOptions |
setFooterTemplate(String footerTemplate)
HTML template for the print footer.
|
Page.PdfOptions |
setFormat(String format)
Paper format.
|
Page.PdfOptions |
setHeaderTemplate(String headerTemplate)
HTML template for the print header.
|
Page.PdfOptions |
setHeight(String height)
Paper height, accepts values labeled with units.
|
Page.PdfOptions |
setLandscape(boolean landscape)
Paper orientation.
|
Page.PdfOptions |
setMargin(Margin margin)
Paper margins, defaults to none.
|
Page.PdfOptions |
setPageRanges(String pageRanges)
Paper ranges to print, e.g., '1-5, 8, 11-13'.
|
Page.PdfOptions |
setPath(Path path)
The file path to save the PDF to.
|
Page.PdfOptions |
setPreferCSSPageSize(boolean preferCSSPageSize)
Give any CSS
@page size declared in the page priority over what is declared in width and height or format
options. |
Page.PdfOptions |
setPrintBackground(boolean printBackground)
Print background graphics.
|
Page.PdfOptions |
setScale(double scale)
Scale of the webpage rendering.
|
Page.PdfOptions |
setWidth(String width)
Paper width, accepts values labeled with units.
|
public Boolean displayHeaderFooter
false
.public String footerTemplate
headerTemplate
.public String format
width
or height
options. Defaults to 'Letter'.public String headerTemplate
"date"
formatted print date"title"
document title"url"
document location"pageNumber"
current page number"totalPages"
total pages in the documentpublic String height
public Boolean landscape
false
.public Margin margin
public String pageRanges
public Path path
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.public Boolean preferCSSPageSize
@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 Boolean printBackground
false
.public Double scale
1
. Scale amount must be between 0.1 and 2.public String width
public Page.PdfOptions setDisplayHeaderFooter(boolean displayHeaderFooter)
false
.public Page.PdfOptions setFooterTemplate(String footerTemplate)
headerTemplate
.public Page.PdfOptions setFormat(String format)
width
or height
options. Defaults to 'Letter'.public Page.PdfOptions setHeaderTemplate(String headerTemplate)
"date"
formatted print date"title"
document title"url"
document location"pageNumber"
current page number"totalPages"
total pages in the documentpublic Page.PdfOptions setHeight(String height)
public Page.PdfOptions setLandscape(boolean landscape)
false
.public Page.PdfOptions setMargin(Margin margin)
public Page.PdfOptions setPageRanges(String pageRanges)
public Page.PdfOptions setPath(Path path)
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.public Page.PdfOptions setPreferCSSPageSize(boolean preferCSSPageSize)
@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 Page.PdfOptions setPrintBackground(boolean printBackground)
false
.public Page.PdfOptions setScale(double scale)
1
. Scale amount must be between 0.1 and 2.public Page.PdfOptions setWidth(String width)
Copyright © 2022. All rights reserved.