pl.wendigo.chrome.api.page / PrintToPDFRequest

PrintToPDFRequest

data class PrintToPDFRequest (source)

Represents request frame that can be used with Page#printToPDF operation call.

Print page as PDF.

Link
Page#printToPDF method documentation.

See Also

PageOperations.printToPDF

Constructors

<init>

PrintToPDFRequest(landscape: Boolean? = null, displayHeaderFooter: Boolean? = null, printBackground: Boolean? = null, scale: Double? = null, paperWidth: Double? = null, paperHeight: Double? = null, marginTop: Double? = null, marginBottom: Double? = null, marginLeft: Double? = null, marginRight: Double? = null, pageRanges: String? = null, ignoreInvalidPageRanges: Boolean? = null, headerTemplate: String? = null, footerTemplate: String? = null, preferCSSPageSize: Boolean? = null, transferMode: String? = null)

Represents request frame that can be used with Page#printToPDF operation call.

Properties

displayHeaderFooter

val displayHeaderFooter: Boolean?

Display header and footer. Defaults to false.

footerTemplate

val footerTemplate: String?

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

headerTemplate

val headerTemplate: String?

HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:

ignoreInvalidPageRanges

val ignoreInvalidPageRanges: Boolean?

Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.

landscape

val landscape: Boolean?

Paper orientation. Defaults to false.

marginBottom

val marginBottom: Double?

Bottom margin in inches. Defaults to 1cm (~0.4 inches).

marginLeft

val marginLeft: Double?

Left margin in inches. Defaults to 1cm (~0.4 inches).

marginRight

val marginRight: Double?

Right margin in inches. Defaults to 1cm (~0.4 inches).

marginTop

val marginTop: Double?

Top margin in inches. Defaults to 1cm (~0.4 inches).

pageRanges

val pageRanges: String?

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

paperHeight

val paperHeight: Double?

Paper height in inches. Defaults to 11 inches.

paperWidth

val paperWidth: Double?

Paper width in inches. Defaults to 8.5 inches.

preferCSSPageSize

val preferCSSPageSize: Boolean?

Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.

printBackground

val printBackground: Boolean?

Print background graphics. Defaults to false.

scale

val scale: Double?

Scale of the webpage rendering. Defaults to 1.

transferMode

val transferMode: String?

return as stream