CSS Paged Media
By default, PDF conversion treats your HTML as a continuous document — pages are created mechanically to fit the content, with no awareness of individual page boundaries.
CSS Paged Media is the W3C standard that defines exactly these typographic capabilities. Two open-source libraries bring full CSS Paged Media support to PolyDoc — include one in your HTML and PolyDoc will pick it up automatically during rendering.
Paged.js
A drop-in polyfill script. Add one
<script> tag to your HTML and Paged.js handles running headers, margin boxes, page counters, bleeds, and more.MITLow setup
Vivliostyle
A CSS typesetting engine that renders your content inside a viewer container. Ideal for complex book-like documents, EPUB, and vertical writing modes.
AGPL-3.0Advanced
Feature comparison
| Feature | Default | Paged.js | Vivliostyle |
|---|---|---|---|
@page size & margin | ✓ | ✓ | ✓ |
Page breaks (break-*) | ✓ | ✓ | ✓ |
| Header & footer (page numbers, static content) | ✓ | ✓ | ✓ |
| Dynamic header content (e.g. current chapter title) | – | ✓ | ✓ |
| Per-page-type styles (cover, left/right pages) | – | ✓ | ✓ |
Cross-references (target-counter) | – | ✓ | ✓ |
| Named pages (e.g. landscape sections) | – | ✓ | ✓ |
| Bleeds & crop marks | – | ✓ | Partial |
| EPUB / vertical writing | – | – | ✓ |
Default = PolyDoc without a polyfill library.