Skip to content

Convert HTML to PDF

POST
/pdf/convert

Returns a PDF file from HTML content or URL. Supports custom page size, margins, and orientation.

object
html

HTML content to convert (required if url not provided)

string
nullable
url

URL to render as PDF (required if html not provided)

string
nullable
format

Page format: A4, Letter, Legal, Tabloid (default: A4)

string
orientation

Page orientation: portrait or landscape (default: portrait)

string
margin

Margins in CSS format, e.g. ‘10mm’ or ‘10mm 20mm’ (default: none)

string
nullable
print_background

Print background graphics (default: true)

boolean
tailwind

Include Tailwind CSS support via CDN (default: true)

boolean
string format: binary
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
nullable
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
nullable