Skip to main content
Sections are the top-level content containers of your document. Every document has a sections array containing one or more sections. Each section holds a content array of elements.

Flow section

The most common section type. Content flows across pages automatically.
{
  "type": "flow",
  "newPage": true,
  "columns": { "count": 2, "space": 1.27, "separate": true },
  "content": [
    { "type": "h1", "text": "Chapter 1" },
    { "type": "text", "text": "Content flows across pages automatically." }
  ]
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "flow"
idstringNoOptional unique identifier. Max: 100 chars.
newPagebooleanNotrueStart this section on a new page. Set to false to continue on the same page as the previous section.
columnsobjectNoMulti-column layout. See Columns.
contentarrayYesArray of content elements. Max: 5000 elements.

Columns

Enable multi-column layout for a flow section.
{
  "type": "flow",
  "columns": { "count": 2, "space": 1.5, "separate": true },
  "content": [ ... ]
}
PropertyTypeRequiredDefaultDescription
countnumberYesNumber of columns (1–4).
spacenumberNo1.27Space between columns in cm (0–5).
separatebooleanNofalseShow a vertical separator line between columns.

Page section

A single positioned page — useful for cover pages, title pages, or any content that needs precise vertical positioning. Content does not flow to the next page.
{
  "type": "page",
  "align": "center",
  "content": [
    { "type": "h1", "text": "My Document", "align": "center" },
    { "type": "text", "text": "A subtitle", "align": "center" }
  ]
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "page"
idstringNoOptional unique identifier. Max: 100 chars.
alignstringNo"top"Vertical alignment: "top", "center", "bottom"
startYnumberNoY position in cm from top (0–100). Overrides align.
contentarrayYesArray of content elements. Max: 200 elements.
Page sections are limited to a single page. If the content exceeds the page height, it will be clipped. Use flow sections for content that should span multiple pages.

Page break

Forces a page break at the current position. Optionally changes the page orientation for subsequent pages.
{ "type": "pageBreak" }
With orientation change:
{ "type": "pageBreak", "orientation": "landscape" }

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "pageBreak"
idstringNoOptional unique identifier. Max: 100 chars.
orientationstringNoChange page orientation after the break: "portrait" or "landscape". If omitted, the current orientation is kept.

Spacer

Adds vertical whitespace between elements.
{ "type": "spacer", "height": 2 }
The height can be specified as a number (line units) or a pixel string:
{ "type": "spacer", "height": "40px" }

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "spacer"
idstringNoOptional unique identifier. Max: 100 chars.
heightnumber | stringNo1Height as line count (0.5–50) or pixel string (e.g., "20px", "50.5px").

Complete example

{
  "document": { "type": "pdf", "size": "A4" },
  "sections": [
    {
      "type": "page",
      "align": "center",
      "content": [
        { "type": "h1", "text": "Annual Report 2025", "align": "center" },
        { "type": "spacer", "height": 2 },
        { "type": "text", "text": "Acme Corporation", "align": "center", "fontSize": 18 }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "toc", "title": "Table of Contents" },
        { "type": "pageBreak" }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "h1", "text": "Executive Summary" },
        { "type": "text", "text": "This section provides an overview of the year." }
      ]
    },
    {
      "type": "flow",
      "columns": { "count": 2, "space": 1.5 },
      "content": [
        { "type": "h1", "text": "Financial Data" },
        { "type": "text", "text": "Left column content..." },
        { "type": "text", "text": "Right column content..." }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "pageBreak", "orientation": "landscape" },
        { "type": "h1", "text": "Appendix: Wide Tables" },
        { "type": "text", "text": "This section uses landscape orientation for wide tables." }
      ]
    }
  ]
}