Generate a PDF
PDFs
PDF Generation
Generate single and multi-page PDFs from templates
POST
Generate a PDF
PDF Generation
Generate PDFs from templates with support for multiple pages, standard paper sizes, and custom dimensions.Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /pdf/render | Render PDF from a template |
POST | /pdf/multi-page | Multi-page PDF with different content per page |
GET | /pdf/presets | List presets for paper sizes |
Paper Size Presets
| Preset | Dimensions | Description |
|---|---|---|
A4 | 210 x 297 mm | ISO standard, most common worldwide |
Letter | 8.5 x 11 in | US standard letter size |
Legal | 8.5 x 14 in | US legal size |
A3 | 297 x 420 mm | Large format |
A5 | 148 x 210 mm | Compact size, booklets |
custom | User-defined | Specify with customSize |
Key Options
| Parameter | Type | Default | Description |
|---|---|---|---|
preset | string | A4 | Paper size preset |
landscape | boolean | false | Landscape orientation |
margins | object | - | Page margins (top, bottom, left, right) in pixels |
customSize | object | - | Custom dimensions when preset is custom |
printBackground | boolean | true | Include CSS backgrounds |
scale | number | 1 | Scale factor (0.1-2.0) |
The
userStorageUrl response field is only included if you have configured custom storage.Best Practices
- Design for print — use CMYK-friendly colors and sufficient margins
- Test at scale — preview PDFs at 100% zoom before production
- Optimize images — use appropriate resolution (150-300 DPI for print)
- Consider page breaks — design templates with natural page breaks for multi-page docs
- Use web-safe fonts — or embed custom fonts in your template
Authorizations
API key obtained from the Pictify dashboard