Page breaks in DOC export

Available in Start planBeta

The PageBreak extension lets users insert explicit page breaks in the editor. When combined with the DOC export extension, these page breaks are included in the exported document.

How it works

Page breaks are fully supported in DOC export. The DOC export uses DOCX conversion under the hood, where pageBreak nodes are converted to <w:br w:type="page"/>, producing standard page breaks in the resulting DOC file.

Setting up PageBreak with DOC export

Register the PageBreak extension alongside the DOC export extension. Page breaks in your editor content will be automatically converted when exporting.

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import { ExportDoc } from '@tiptap-pro/extension-export-doc'
import { PageBreak } from '@tiptap-pro/extension-pagebreak'

const editor = new Editor({
  extensions: [
    StarterKit,
    PageBreak,
    ExportDoc.configure({
      appId: 'your-app-id',
      token: 'your-jwt',
      onCompleteExport: (result) => {
        const blob = new Blob([result], { type: 'application/msword' })
        const url = URL.createObjectURL(blob)
        const a = document.createElement('a')
        a.href = url
        a.download = 'export.doc'
        a.click()
        URL.revokeObjectURL(url)
      },
    }),
  ],
})

Learn more