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

Pixel values use standard CSS pixels (one inch is 96 pixels). The constants preserve fractional pixel precision internally; the integers below are rounded for readability.

FormatWidth (px)Height (px)Margins (px: top / right / bottom / left)
A4794112395 / 76 / 95 / 76
A31123158795 / 76 / 95 / 76
A555979476 / 57 / 76 / 57
Letter816105696 / 96 / 96 / 96
Legal816134596 / 96 / 96 / 96
Tabloid1056163396 / 96 / 96 / 96

For the underlying real-world measurements in centimetres, see Page format.