Imposia Documentation
Turn React HTML into browser pages you can preview, print, and save as PDF.
Build a feature where people edit content and print it, and you usually end up with three documents claiming to be the same one: the editor renders the content, the preview clones it, and the print path reconstructs it somewhere else. Then the preview says 12 pages and the PDF has 13, and nobody can say which one is correct — because nothing decided which one was authoritative.
Imposia removes that question. It turns the HTML and CSS you already have into one paginated document inside the browser, and every surface — preview, native print, Save as PDF — observes that same finished document.
Build your first page
Install the React package and render HTML as A4 pages in about ten minutes.
Load images and fonts
Implement assetResolver, the only path external resources can take.
The publishing model
Why the preview, the printed page, and the PDF always agree with each other.
API reference
React handles, Core controllers, Viewer navigation, and lifecycle rules.
What happens to your HTML
- Your app passes HTML, CSS, and page options to Imposia.
- Core paginates the next version in a temporary iframe.
- When pagination finishes, Imposia replaces the visible document in one step.
If pagination fails or a newer update arrives first, readers keep seeing the last completed document. They never see a half-finished layout.
What one committed source can produce
| Output | How you get it | What you receive |
|---|---|---|
| Preview | The React Viewer | The completed pages, presented from the canonical iframe |
| Print or PDF | print() | The browser's native print dialog, where the reader picks a printer or Save as PDF |
| EPUB | exportEpub() | Optional. A reflowable EPUB 3.3 Blob built from the committed semantic source |
Know the boundary
Imposia does not produce PDF bytes
print() opens the browser's own print flow. There is no PDF renderer, no Node or CLI renderer, and no server publishing API. If your application needs PDF bytes on a server, Imposia is not the right tool — use a headless browser or a server-side renderer instead.
Imposia runs in the browser and ships as ESM. If that matches your application, continue with Build your first page.