class ConversionParameters : Parameters
Configuration for a conversion.
Options may require a minimum subscription tier to be usable. See the documentation for information on the available options.
ConversionParameters(html: String? = null, url: String? = null, cdn: Boolean? = null, storage: StorageParameter? = null, landscape: Boolean? = null, printBackground: Boolean? = null, scale: Float? = null, format: PaperFormat? = null, paperWidth: String? = null, paperHeight: String? = null, margin: String? = null, marginTop: String? = null, marginRight: String? = null, marginBottom: String? = null, marginLeft: String? = null, pageRanges: MutableList<String> = mutableListOf(), headerTemplate: String? = null, : String? = null, preferCSSPageSize: Boolean? = null, viewportWidth: Float? = null, viewportHeight: Float? = null, blockAds: Boolean? = null, selector: String? = null, waitForSelector: String? = null, waitForSelectorTimeout: Duration? = null, waitUntil: WaitUntil? = null, waitUntilTimeout: Duration? = null, delay: Duration? = null, timeout: Duration? = null, headers: MutableMap<String, Any> = mutableMapOf(), emulateMedia: Media? = null, ownerPassword: String? = null, userPassword: String? = null, allowErrorPage: Boolean? = null, optimize: Boolean? = null)
Configuration for a conversion. |
var allowErrorPage: Boolean?
Allow HTTP status codes outside the 2xx range to be captured. |
|
var blockAds: Boolean?
Indicates if the browser should try to remove ads from the page. |
|
var cdn: Boolean?
Indicates if the PDF should be served via the CDN. |
|
var delay: Duration?
Delay the capturing of the page for this duration. |
|
var emulateMedia: Media?
Which CSS media to emulate. |
|
var footerTemplate: String?
HTML template for the PDF footer. |
|
var format: PaperFormat?
Paper format. |
|
var headerTemplate: String?
HTML template for the PDF header. |
|
var headers: MutableMap<String, Any>
Custom HTTP headers that will be attached to the request from the PDFire service to the provided URL. |
|
var html: String?
The HTML string to convert to a PDF. |
|
var landscape: Boolean?
Indicates if the page should be captured in landscape mode. |
|
var margin: String?
Margins of the page. |
|
var marginBottom: String?
Bottom margin of the page (overrides margin). |
|
var marginLeft: String?
Left margin of the page (overrides margin). |
|
var marginRight: String?
Right margin of the page (overrides margin). |
|
var marginTop: String?
Top margin of the page (overrides margin). |
|
var optimize: Boolean?
Apply CSS optimizations to the page. |
|
var ownerPassword: String?
Secures the PDF with an owner password. |
|
var pageRanges: MutableList<String>
Page ranges that should be captured. |
|
var paperHeight: String?
Paper height. |
|
var paperWidth: String?
Paper width. |
|
var preferCSSPageSize: Boolean?
Indicates if the page's CSS rule should take precedence over the paperWidth, paperHeight and format options. |
|
var printBackground: Boolean?
Indicates if the background images of the page should be included in the PDF. |
|
var scale: Float?
Sets the zoom of the page. |
|
var selector: String?
DOM selector for the HTML element that should be captured. |
|
var storage: StorageParameter?
Storage configuration for the PDF. |
|
var timeout: Duration?
General timeout for the conversion request. |
|
var url: String?
The URL to convert to a PDF. |
|
var userPassword: String?
Secures the PDF with a user password. |
|
var viewportHeight: Float?
Height of the browser's viewport. |
|
var viewportWidth: Float?
Width of the browser's viewport. |
|
var waitForSelector: String?
DOM selector the service should wait for before capturing the page. |
|
var waitForSelectorTimeout: Duration?
Timeout for the waitForSelector option. |
|
var waitUntil: WaitUntil?
Browser event to wait for before capturing the page. |
|
var waitUntilTimeout: Duration?
Timeout for the waitUntil option. |
fun addPageRange(range: String): Unit
Add page ranges that should be captured. |
|
fun secure(owner: String? = null, user: String? = null): Unit
Secure the PDF with an owner / user password. |
|
fun setMargin(margin: Int): Unit
Set the margins of the PDF in pixel. |
|
fun setMarginBottom(margin: Int): Unit
Set the bottom margin of the PDF in pixel. |
|
fun setMarginBottomCentimeter(margin: Float): Unit
Set the bottom margin of the PDF in centimeter. |
|
fun setMarginBottomInch(margin: Float): Unit
Set the bottom margin of the PDF in inches. |
|
fun setMarginBottomMillimeter(margin: Float): Unit
Set the bottom margin of the PDF in millimeter. |
|
fun setMarginBottomPixel(margin: Float): Unit
Set the bottom margin of the PDF in pixel. |
|
fun setMarginCentimeter(margin: Float): Unit
Set the margins of the PDF in centimeter. |
|
fun setMarginInch(margin: Float): Unit
Set the margins of the PDF in inches. |
|
fun setMarginLeft(margin: Int): Unit
Set the left margin of the PDF in pixel. |
|
fun setMarginLeftCentimeter(margin: Float): Unit
Set the left margin of the PDF in centimeter. |
|
fun setMarginLeftInch(margin: Float): Unit
Set the left margin of the PDF in inches. |
|
fun setMarginLeftMillimeter(margin: Float): Unit
Set the left margin of the PDF in millimeter. |
|
fun setMarginLeftPixel(margin: Float): Unit
Set the left margin of the PDF in pixel. |
|
fun setMarginMillimeter(margin: Float): Unit
Set the margins of the PDF in millimeter. |
|
fun setMarginPixel(margin: Float): Unit
Set the margins of the PDF in pixel. |
|
fun setMarginRight(margin: Int): Unit
Set the right margin of the PDF in pixel. |
|
fun setMarginRightCentimeter(margin: Float): Unit
Set the right margin of the PDF in centimeter. |
|
fun setMarginRightInch(margin: Float): Unit
Set the right margin of the PDF in inches. |
|
fun setMarginRightMillimeter(margin: Float): Unit
Set the right margin of the PDF in millimeter. |
|
fun setMarginRightPixel(margin: Float): Unit
Set the right margin of the PDF in pixel. |
|
fun setMarginTop(margin: Int): Unit
Set the top margin of the PDF in pixel. |
|
fun setMarginTopCentimeter(margin: Float): Unit
Set the top margin of the PDF in centimeter. |
|
fun setMarginTopInch(margin: Float): Unit
Set the top margin of the PDF in inches. |
|
fun setMarginTopMillimeter(margin: Float): Unit
Set the top margin of the PDF in millimeter. |
|
fun setMarginTopPixel(margin: Float): Unit
Set the top margin of the PDF in pixel. |
|
fun setPaperHeight(height: Int): Unit
Set the paper height of the PDF in pixel. |
|
fun setPaperHeightCentimeter(height: Float): Unit
Set the paper height of the PDF in centimeter. |
|
fun setPaperHeightInch(height: Float): Unit
Set the paper height of the PDF in inches. |
|
fun setPaperHeightMillimeter(height: Float): Unit
Set the paper height of the PDF in millimeter. |
|
fun setPaperHeightPixel(height: Float): Unit
Set the paper height of the PDF in pixel. |
|
fun setPaperWidth(width: Int): Unit
Set the paper width of the PDF in pixel. |
|
fun setPaperWidthCentimeter(width: Float): Unit
Set the paper width of the PDF in centimeter. |
|
fun setPaperWidthInch(width: Float): Unit
Set the paper width of the PDF in inches. |
|
fun setPaperWidthMillimeter(width: Float): Unit
Set the paper width of the PDF in millimeter. |
|
fun setPaperWidthPixel(width: Int): Unit
Set the paper width of the PDF in pixel. |
|
fun toMap(): Map<String, Any?>
Create a map from the parameters. |
|
fun useStorage(configure: (StorageParameter) -> Unit): Unit
Serve the PDF via a custom cloud storage disk. fun useStorage(use: Boolean = true): Unit
Serve the PDF via the default custom cloud storage disk. |
|
fun waitUntilDOM(): Unit
Wait for the browser's "DOMContentLoaded" event before capturing the page. |
|
fun waitUntilLoad(): Unit
Wait for the browser's "load" event before capturing the page. |
|
fun withHeaders(headers: Map<String, Any>): Unit
Add custom headers to the request the PDFire server makes to the provided url. |