Forma PDF
Embed a visual PDF template editor in JavaScript
By WVSTECH · Reviewed November 23, 2026 · Examples target SDK 0.4.0
Embed Forma PDF when your users need to design documents themselves. The editor exposes pages, text, images, tables and field bindings; the PDF engine also works independently when users only need a download button.
Mount the editor in a container
Serve the purchased SDK and its styles from your application. Give the host an explicit height so the page list, canvas and property panel have room to scroll.
import { createEditor, getTemplate } from './sdk/forma-pdf.js'
const starter = getTemplate('quotation')
const editor = createEditor(document.querySelector('#pdf-editor'), {
layout: starter.layout,
values: starter.values,
locale: 'en',
onChange: ({ structure, values }) => {
saveDraft({ layout: structure, values })
}
})
Save drafts in your application
saveDraft above is your persistence function, not an SDK method. Debounce it and handle authorization and errors in your application. You can also save explicitly using editor.getEstruct() and editor.getValues(). Call editor.destroy() when removing the component.
Who sees the editor?
Only users to whom your app exposes it. A template designer can use the full workspace while customers see a small form and a Generate PDF button. The public playground is a demonstration, not a mandatory screen in your product.
Continue building
- Add PDF templates to a Bolt or Lovable project
- Generate a PDF from JSON in the browser
- Integrate a PDF editor with React and Next.js
- Save PDF templates as JSON in your database
- Create editable PDF templates in Bubble workflows
- Automatic PDF page breaks for text and tables
- 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?