PDFCraft
Render option

Set the paper size of a generated PDF

Paper size. Ignored if the page CSS declares its own @page size.

Fieldoptions.format
TypeA4 | A3 | A5 | Letter | Legal | Tabloid
Default"A4"

What it is for

Picks the paper the page is laid out on. A4 by default, which is right everywhere except North America — Letter is 8.5×11in against A4’s 8.27×11.69in, so a layout tuned for one overflows the other by a few millimetres rather than obviously.

The trap

Ignored entirely if your CSS declares its own @page size. That is not a bug: a stylesheet that says @page { size: A5 } has stated an intention this option should not override. If format seems to do nothing, grep your CSS for @page first.

Example

curl -X POST https://api.pdfcraft.dev/v1/render \
  -H "Authorization: Bearer $PDFCRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>hello</h1>",
    "options": {
      "format": "Letter"
    }
  }' \
  --output out.pdf

Every option

Try any of these in the playground without writing a line of code, or read the full reference.