Paper sizes and custom page dimensions.
Page Formats
Choose the right paper format for your PDF documents. PDF API supports standard paper sizes and custom dimensions.
| Format | Dimensions (mm) | Dimensions (in) | Use Case |
|---|
A3 | 297 × 420 | 11.7 × 16.5 | Posters, diagrams |
A4 | 210 × 297 | 8.3 × 11.7 | Standard documents |
A5 | 148 × 210 | 5.8 × 8.3 | Booklets, flyers |
| Format | Dimensions (in) | Dimensions (mm) | Use Case |
|---|
Letter | 8.5 × 11 | 216 × 279 | Standard US documents |
Legal | 8.5 × 14 | 216 × 356 | Legal documents |
Tabloid | 11 × 17 | 279 × 432 | Newspapers, posters |
{
"markdown": "# Document",
"options": {
"format": "A4"
}
}
With landscape orientation:
{
"options": {
"format": "A4",
"landscape": true
}
}
For non-standard sizes, specify width and height:
{
"options": {
"width": "6in",
"height": "9in"
}
}
| Unit | Example | Description |
|---|
mm | 210mm | Millimeters |
cm | 21cm | Centimeters |
in | 8.5in | Inches |
px | 794px | Pixels (96 DPI) |
| Type | Width | Height | Aspect |
|---|
| Pocket Book | 4.25in | 6.87in | 0.62 |
| Trade Paperback | 5.5in | 8.5in | 0.65 |
| US Trade | 6in | 9in | 0.67 |
| Royal | 6.14in | 9.21in | 0.67 |
| Digest | 5.5in | 8.5in | 0.65 |
{
"options": {
"width": "6in",
"height": "9in"
}
}
| Type | Width | Height |
|---|
| Business Card | 3.5in | 2in |
| Postcard | 6in | 4in |
| Flyer (Half Letter) | 5.5in | 8.5in |
| Brochure (Tri-fold) | 8.5in | 11in |
{
"options": {
"width": "6in",
"height": "4in",
"landscape": true
}
}
| Platform | Width | Height | Notes |
|---|
| Instagram Post | 1080px | 1080px | Square |
| Instagram Story | 1080px | 1920px | 9:16 |
| Facebook Cover | 820px | 312px | Banner |
{
"options": {
"width": "1080px",
"height": "1080px"
}
}
Content flows top to bottom, best for documents with mostly text.
{
"options": {
"format": "A4",
"landscape": false
}
}
Content flows with wider width, best for tables, charts, and presentations.
{
"options": {
"format": "A4",
"landscape": true
}
}
| Mode | A4 Width | A4 Height |
|---|
| Portrait | 210mm | 297mm |
| Landscape | 297mm | 210mm |
Calculate the usable content area by subtracting margins:
Content Width = Page Width - Left Margin - Right Margin
Content Height = Page Height - Top Margin - Bottom Margin - Header - Footer
| Property | Value |
|---|
| Page Width | 210mm |
| Page Height | 297mm |
| Left/Right Margins | 20mm each |
| Top/Bottom Margins | 25mm each |
| Content Width | 170mm |
| Content Height | 247mm |
- Match your audience: Use Letter for US, A4 for international
- Consider printing: Standard formats are easier to print
- Account for binding: Add extra margin on the binding edge for booklets
- Test margins: Ensure content doesn't get cut off near edges
- Use landscape for data: Tables and charts often fit better in landscape
{
"template": "invoice",
"options": {
"format": "Letter",
"margin": {
"top": "25mm",
"bottom": "25mm",
"left": "20mm",
"right": "20mm"
}
}
}
{
"options": {
"format": "A4",
"landscape": true,
"margin": {
"top": "15mm",
"bottom": "15mm",
"left": "15mm",
"right": "15mm"
}
}
}
{
"options": {
"width": "6in",
"height": "9in",
"margin": {
"top": "20mm",
"bottom": "20mm",
"left": "25mm",
"right": "15mm"
}
}
}