Breaks and Pagination
Content flows from page to page on its own. Two tools steer where the pages break: a break node placed in the content array, and the break keys of a style, which are CSS Fragmentation's (breakBefore, breakAfter, breakInside, orphans, widows). The page numbers the pages then carry are set in Page Setup.
Break types
| Value | Description |
|---|---|
"page" | Start content on a new page |
"section" | Start a new page-level section, optionally with its own page setup, header, footer or watermarks |
"line" | Insert a line break within flowing content (equivalent to a blank line) |
"left", "right" | Break until the next page is a left-hand or right-hand page, adding a blank page when needed |
"recto", "verso" | The same, by the side of the spread: recto is an odd-numbered page and verso an even one, whichever way the document reads |
Page break
Force the following content onto a new page.
{ "break": "page" }
Example: multi-chapter document
{
"document": {
"styles": {
"title": { "fontSize": 18, "fontWeight": "bold" },
"body": { "fontSize": 10 }
},
"content": [
{ "p": "Chapter 1: Introduction", "style": "title" },
{ "p": "This content appears on the first page.", "style": "body" },
{ "break": "page" },
{ "p": "Chapter 2: Analysis", "style": "title" },
{ "p": "This content starts on a new page.", "style": "body" },
{ "break": "page" },
{ "p": "Chapter 3: Conclusion", "style": "title" },
{ "p": "This content starts on another new page.", "style": "body" }
]
}
}
Use page breaks for:
- Chapters — start each chapter on a fresh page
- Cover pages — separate the cover from the body
- Appendices — isolate supplementary content from the main body
- Before large tables — ensure a table starts at the top of a page rather than splitting awkwardly
Breaking to a side
left, right, recto and verso break until the next page is that side. When the page after the break would be the wrong side, a blank page is added first. Which side a page is depends on the reading direction: in a left-to-right document page 1 is a right page; when the body style sets "direction": "rtl", page 1 is a left page. recto and verso follow the page number alone.
{
"document": {
"content": [
{ "h1": "Cover" },
{ "break": "recto" },
{ "h1": "Part one" },
{ "p": "Opens on page 3: page 2 is left blank so the part starts on a right-hand page." }
]
}
}
A blank page added this way carries no header, footer or page number: it is the cost of landing on the side asked for, as a blank verso is in print.
Section break
Partition the document into page-level sections. Each section can carry its own inline pageSetup (size, orientation, margins, background, frame, page numbering), header, footer and watermarks — all on the break itself. Use it for cover pages, landscape appendices, front matter numbered in roman numerals, or any document that needs different page configuration partway through.
{ "break": "section",
"pageSetup": { "size": "LETTER", "orientation": "landscape" }
}
Properties on the inline pageSetup override the document-root pageSetup for every page in this section. Each property is independent: omit a key to inherit it from the root, never from the section before. Omit the pageSetup field entirely to return to the root's page setup. Two parts carry on instead of returning to the root: the page count (pageNumbering absent continues it), and the header and footer, which apply from the section that sets them on. watermarks replaces the document's for the section, and "watermarks": [] draws none.
pageSetup and watermarks beside any other kind of break are not read, and a warning says so: only break: "section" opens a section.
For the full mechanics see Page Setup and Headers & Footers.
Example: landscape appendix
{
"document": {
"pageSetup": {
"size": "LETTER",
"orientation": "portrait"
},
"styles": {},
"content": [
{
"h1": "Main report"
},
{
"p": "Body of the portrait-oriented report."
},
{
"break": "section",
"pageSetup": {
"size": "LETTER",
"orientation": "landscape",
"margin": [
40,
40,
40,
40
]
}
},
{
"h1": "Appendix A — Wide tables"
},
{
"p": "This section renders in landscape with wider margins."
}
]
}
}
A section break always starts a new page, whatever its page setup. A section break the content opens with makes no blank page: page 1 takes the section's setup.
Line break
Insert vertical spacing between content elements without starting a new page or section.
{ "break": "line" }
Example: spacing between blocks
{
"document": {
"content": [
{ "p": "Terms and Conditions" },
{ "p": "Please review the following carefully." },
{ "break": "line" },
{ "p": "1. The agreement is binding upon signature." },
{ "p": "2. Termination requires 30 days written notice." },
{ "break": "line" },
{ "p": "Contact legal@acme.com for questions." }
]
}
}
Breaking from a style
A style can ask for a break before or after every block that wears it, so a house style opens each chapter on a new page with no break node in the content.
| Key | Values | Default | Does |
|---|---|---|---|
breakBefore | auto, always, page, left, right, recto, verso, avoid, column | auto | A break before the block. always and page force one; left, right, recto and verso break to that side; avoid keeps the block with the one before it; column starts it in the next column of a column flow |
breakAfter | the same | auto | A break after the block; avoid keeps it with the block after |
breakInside | auto, avoid, avoidPage | auto | avoid and avoidPage keep the block on one page when it fits on one |
orphans | whole number, 1 or more | 2 | The fewest lines of a paragraph left at the foot of a page when it breaks |
widows | whole number, 1 or more | 2 | The fewest lines of a paragraph carried to the head of the next page |
column acts on a block of a column flow, as Column breaks describes; on any other block it does nothing, and a notice says so.
{
"document": {
"styles": {
"chapter": { "fontSize": 20, "fontWeight": "bold", "breakBefore": "recto", "breakAfter": "avoid" },
"body": { "orphans": 3, "widows": 3 },
"keep": { "breakInside": "avoid" }
},
"content": [
{ "p": "Cover" },
{ "p": "Chapter 1", "style": "chapter" },
{ "p": "The chapter title opens a right-hand page and never stands alone at the foot of one.", "style": "body" },
{ "p": "A paragraph that must not be divided between two pages.", "style": "keep" }
]
}
}
breakAfter: "avoid"on a heading keeps it with the start of the next block: the heading moves to the next page with the paragraph's first lines, or with the whole of a table, list or column block that is kept together.breakBefore: "avoid"on the block after says the same thing from the other side.breakInside: "avoid"moves a paragraph, a list, a table or a column block whole to the next page when it does not fit in the room left. A block no page can hold breaks anyway: a table asked to stay whole that is taller than a page splits between its rows.orphansandwidowsare inherited, as in CSS: set them on thebodystyle and they apply to every paragraph, including the paragraphs inside list items, table cells and columns.breakInside: "avoid"wins over both.- Breaks that meet at one point act as one: a break node next to a
breakBeforeorbreakAftergives one new page, and where the sides asked for disagree the last one wins.
A box across a break
| Key | Takes | Default | What it does |
|---|---|---|---|
boxDecorationBreak | slice, clone | slice | What a bordered or shaded box does where a page breaks it, or a line breaks a [span]'s box. slice cuts it as if one tall box were divided: no border, padding or rounded corner at the break. clone wraps each piece in the whole box, closed, padded and rounded. |
clone suits a notice or a code listing that runs onto the next page, so its frame reads as one on each page, and a
highlighted headline whose every line keeps its padding. An image, an svg, a table row, a header and a watermark are never
broken, so the key does nothing there, and the render says so.
{
"styles": {
"notice": { "border": "1.5pt solid #047857", "padding": 12, "borderRadius": 6, "boxDecorationBreak": "clone" },
"marker": { "backgroundColor": "#fde047", "padding": "1 6", "boxDecorationBreak": "clone" }
},
"content": [
{ "p": "A notice long enough to run onto the next page keeps its frame on both.", "style": "notice" },
{ "p": "[span, marker]A highlighted headline whose words wrap across lines[/span]" }
]
}
Repeating table headers
A table's header rows (its leading rows made entirely of th cells) are drawn again at the top of every page the table crosses. repeatHeader: false in the style the table wears turns that off.
{
"document": {
"styles": { "onceOnly": { "repeatHeader": false } },
"content": [
{
"table": {
"style": "onceOnly",
"widths": [1, 3],
"rows": [
[ { "th": "No" }, { "th": "Entry" } ],
[ { "td": "1" }, { "td": "Printed with its header once, on the first page only." } ]
]
}
}
]
}
}
| Where | Key | Default |
|---|---|---|
| style | repeatHeader | true |
A header taller than a quarter of the page is drawn once and not repeated. Under a PDF/UA claim the repeats are page furniture: the table's structure holds its header once.
How each kind of block breaks
| Block | At a page break |
|---|---|
| Paragraph | Breaks between lines, keeping orphans lines at the foot and widows at the head |
| List item | Breaks like the paragraph it holds; its marker stays beside the first line, and nested numbering carries on across the page (2.31 at the foot, 2.32 at the head) |
| Table | Breaks between rows. A row is not divided; a row span is never cut, so the rows it spans move together; a table nested in a cell moves whole with its row. The header rows repeat (see above) |
| Columns | A flowing column block breaks its columns at the page as at a column's foot, orphans and widows included. A row of a columns grid that a page can hold moves whole |
| Image, svg, barcode, rule | Never divided: one that does not fit in the room left moves to the next page |
| Header, footer, watermark | Not part of the flow, so never broken; break keys on them are reported as doing nothing |
A block taller than a whole page (a very tall picture, a table row or a single unbreakable line) starts at the top of a page and runs past its foot, and a notice names its height and the room there was. No blank page is spent first.
In a DOCX
pagebreaks andbreakBefore/breakAfterare Word page breaks, andcolumna Word column break;avoidandbreakInside: "avoid"become Word's keep-with-next and keep-lines-together, and a table or list kept together is kept on one page.- Word closes every box a page breaks, and every
[span]border on each line, which isboxDecorationBreak: clone: aslicebox shows its border at Word's own page breaks. - A break to a side (
left,right,recto,verso) is a section that begins on the next odd or even page. The blank page it needs is not in the file: the application that opens it adds it when it lays out the pages, as Word does. The render report says the page is not in the file. - Word has one switch for orphans and widows, on or off, so
2/2(the default) and1/1are carried; any other count is written as the nearer of the two, with a warning, and holds exactly in the PDF. - Header rows are marked as repeating rows and Word decides on each page whether they fit.
Notes
- A
pagebreak at the very end of the content array adds a trailing blank page. Avoid it unless intentional. - To leave a page blank, break to a side (
left,right,recto,verso): twopagebreaks in a row give one new page. - A
pagebreak before any content adds no page: the document already starts on a new one. - Content that naturally exceeds the page height wraps automatically — you don't need page breaks for overflow. Use them only for intentional structural divisions.
sectionbreaks always advance to a new page, even when the section's page setup is the same as the previous one's.linebreaks never advance to a new page — they're equivalent to a blank line.- A
sectionbreak is unrelated to thecolumnselement.columnsis an inline multi-column layout block;break: sectionis a page-level partition with its own page setup.