Page formats constants
The PAGE_FORMATS
constant provides a set of predefined page formats (such as A4, A3, Letter, etc.) with real-world dimensions and recommended margins, already converted to pixels. This is useful for quickly setting up the pageFormat
option or custom layouts in the Tiptap Pages extension.
Import
import { PAGE_FORMATS } from '@tiptap-pro/extension-pages'
API
PAGE_FORMATS: {
[format: string]: {
id: string
width: number // in pixels
height: number // in pixels
margins: {
top: number
right: number
bottom: number
left: number
}
}
}
Available Formats
Format | Width (px) | Height (px) | Margins (px: top/right/bottom/left) |
---|---|---|---|
A4 | 794 | 1123 | 95 / 76 / 95 / 76 |
A3 | 1123 | 1591 | 95 / 76 / 95 / 76 |
A5 | 419 | 794 | 76 / 57 / 76 / 57 |
Letter | 818 | 1060 | 96 / 96 / 96 / 96 |
Legal | 818 | 1404 | 96 / 96 / 96 / 96 |
Tabloid | 1060 | 1635 | 96 / 96 / 96 / 96 |