Authorizations
Body
HTML code.
Set ID of HTML template to be used. View and manage your templates at HTML to PDF Templates.
please set to string converted from JSON with data for Mustache template or leave empty if no template is used
Set custom margins, overriding CSS default margins. Specify the margins in the format {top} {right} {bottom} {left}. You can usepx,mm,cmorinunits. Also, you can set margins for all sides at once using a single value.
"10px 10px 10px 10px"
Specifies the paper size. Accepts standard sizes like 'Letter', 'Legal', 'Tabloid', 'Ledger', 'A0'–'A6'. You can also set a custom size by providing width and height separated by a space, with optional units: px (pixels), mm (millimeters), cm (centimeters), or in (inches). Examples: '200 300', '200px 300px', '200mm 300mm', '20cm 30cm', '6in 8in'.
Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 "A4"
Sets the document orientation. Options: Portrait for vertical layout, and Landscape for horizontal layout.
Portrait, Landscape Set to false to disable background colors and images are included when generating PDFs from HTML/URL
Controls how content is rendered when converting to PDF. Options: print (uses print styles), screen (uses screen styles), none (no media type applied).
print, screen, none Controls how thoroughly the converter waits for a page to load before converting HTML to PDF --- false waits for full page load, while true speeds up conversion by waiting only for minimal loading.
Set this to can add user definable HTML for the header to be applied on every page header. The format is html.
Set this to can add user definable HTML for the footer to be applied on every page bottom. The format is html.
use legacy rendition (optional)
File name for generated output.
Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks
Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.