> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dockiln.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Margins

> Set a uniform page margin or specify each edge in physical units for a Chromium PDF.

## Set one margin on all sides

For the standard page options, `page.margin` is a whole number from 8 to 35, measured in millimetres. This example can go directly to [POST /v1/documents](https://docs.dockiln.io/api-reference/queue-generation.md).

```json theme={null}
{
  "html": "<h1>Purchase order</h1><p>Allow space for filing.</p>",
  "page": { "format": "A4", "margin": 18 }
}
```

## Set edges independently

On the 1.1 build, `print.margins` controls the Chromium PDF print area. Specify a length with a unit for each edge you want to override. Omitted edges retain their page margin.

```json theme={null}
{
  "html": "<h1>Bound report</h1><p>The inner edge leaves space for binding.</p>",
  "print": {
    "paper": "Letter",
    "margins": { "top": "0.75in", "right": "12mm", "bottom": "18mm", "left": "25mm" }
  }
}
```

Accepted units are `px`, `pt`, `mm`, `cm` and `in`, with up to three decimal places. Each edge must convert to 0–500 CSS pixels (96 px per inch). For structured Typst templates, set the template's page margin. For HTML with repeated bands, leave room for the [header and footer](https://docs.dockiln.io/misc/header-footer.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.