Skip to main content
POST
curl

Body

application/json

Exactly one of html or url must be provided.

html
string

HTML document to render

url
string<uri>

Public URL to render

format
string
default:A4

Paper format. Named sizes: A0–A6, Letter, Legal, Tabloid, Ledger (default A4). Or {width}x{height} with optional units, e.g. 210mmx297mm or 11x17 (inches when omitted). Height auto (1024xauto, 210mmxauto) renders a single scrolling page; unitless width is pixels (÷96 → inches).

paper_width
string

Overrides format width (Gotenberg units, e.g. 8.5in). Must be paired with paper_height.

paper_height
string

Overrides format height. Must be paired with paper_width.

landscape
boolean
print_background
boolean
scale
number
default:1

Render scale (default 1)

zoom
number

Alias for scale when scale is unset

margin
object
header
object
wait_delay
string

Pause before print (Go duration, e.g. 2s or 500ms). Max 30s.

wait_for_selector
string

CSS selector; Chromium waits until a matching element exists.

wait_for_expression
string

JavaScript expression; Chromium waits until it is truthy.

wait_for_network_idle
boolean

When true, wait for Chromium network idle (0 connections for 500ms).

extra_http_headers
object

Headers Chromium sends while loading the page (URL assets included). Cookie and hop-by-hop names are rejected; use cookies for Cookie.

cookies
object[]
sandbox
boolean

Watermarked PDF; does not increment usage. Response includes X-Sandbox: true and omits X-Usage-Count. Still uses a concurrency slot.

pages
string

Page ranges to keep, e.g. 1-3,6. Cannot combine with single_page or auto height.

single_page
boolean

One continuous page (also implied by {width}xauto format).

emulate_media
enum<string>

Chromium media type. Default is print.

Available options:
print,
screen
css
string

Inline CSS or a public http(s) stylesheet URL (SSRF-checked).

javascript
string

Inline JS or a public http(s) script URL (SSRF-checked).

raise_for_status
boolean

true fails on 3xx/4xx/5xx of the main URL. false allows error pages. Omit to keep Gotenberg default (fail on 4xx/5xx).

auth
object

HTTP Basic auth for the page URL. Conflicts with extra_http_headers Authorization.

lazy_load_images
boolean

Scroll the page so lazy-loaded images fetch before print.

metadata
object

Response

PDF bytes

The response is of type file.