Forma PDF
Automatic PDF page breaks for text and tables
By WVSTECH · Reviewed November 23, 2026 · Examples target SDK 0.4.0
Forma PDF can paginate growing text and tables when automatic page breaks are enabled. The output is not restricted to the one page visible in a starter template: document content can produce additional pages.
Enable automatic page breaks
const paginatedLayout = {
...savedLayout,
page: { ...savedLayout.page, automaticPageBreaks: true }
}
const document = await resolveDocument(paginatedLayout, values)
console.log(document.pages.length)
const pdf = await generatePDF(paginatedLayout, values)
Respect the paper dimensions
Field positions and sizes are in millimeters. An A4 portrait page is 210 × 297 mm; Letter and landscape are also supported. A field positioned outside its source page is an invalid layout, not a request for another page. Place fields inside the paper bounds and let supported content overflow create continuation pages.
Long tables and repeated content
Tables can continue across pages with repeated column headers. Brand and page settings can reserve room for recurring headers and footers. Test both short and long real-world records because row height changes with text length.
resolveDocument returns the calculated page plan. Store the original template, then recalculate with each new values object. The browser still needs enough memory for the requested document; multi-page support is not a promise of unlimited resource usage.
Continue building
- Add PDF templates to a Bolt or Lovable project
- Generate a PDF from JSON in the browser
- Embed a visual PDF template editor in JavaScript
- Integrate a PDF editor with React and Next.js
- Save PDF templates as JSON in your database
- Create editable PDF templates in Bubble workflows
- Build a quotation PDF generator for your application
- Create a restaurant menu PDF from structured data
- Generate internal documents and memos from app data
- Generate PDF templates with OpenAI or Claude
- PDF generation, document data and API-key security
- PDF template editor or a simple Generate PDF button?