Convert HTML to PDF.
POST/pdf/html
Convert HTML to PDF.
Request
Header Parameters
- application/json
Bodyrequired
- string
- number
- string
- number
- number
- string
- number
- string
- number
- string
- number
- string
The URL of the website.
The HTML source. Can be specified instead of url
Whether the result PDF should be returned as a URL. Default is false.
trueThe PDF file name. Default is a random ID.
options object
The scale of the web app. Default is 1.
Possible values: >= 0.1 and <= 2
1Show header and footer. Default is false.
falseWhether to include the background in the PDF. Default is false.
falseWhether the PDF should be in landscape orientation. Default is false.
falseThe page ranges to output.
1-3,8,15-20The format of the result PDF. This overwrites the width and height settings.
Possible values: [letter, Letter, LETTER, legal, Legal, LEGAL, tabloid, Tabloid, TABLOID, ledger, Ledger, LEDGER, a0, A0, a1, A1, a2, A2, a3, A3, a4, A4, a5, A5, a6, A6]
a4width object
The width of the result PDF. Either a number in points or a string with a unit.
height object
The height of the result PDF. Either a number in points or a string with a unit.
Overwrite the format, width and height settings with the page size defined by CSS. Default is false.
falsemargin object
The margins of the output PDF. Default is no margins.
top object
bottom object
left object
right object
Do not use default white background, which makes the PDF transparent. Default is false.
falseGenerate accessible PDF. Default is true.
trueResponses
- 200
- 400
Success
- application/json
- application/octet-stream
- Schema
- Example (auto)
Schema
{
"url": "string"
}
- Schema
Schema
Bad Request
- application/json
- Schema
- Example (auto)
Schema
{
"status": 0,
"errorMessage": "string"
}