software · Q305
Paged.js
JavaScript pagination library for previewing and producing print-oriented documents with browser technology.
Overview
Paged.js is a JavaScript library that paginates HTML content for print-oriented output. It translates supported paged-media CSS into structures and styles a browser can render, providing an on-screen page preview that can be saved as PDF. It is an MIT-licensed library with an associated command-line renderer, rather than a standalone desktop publishing editor.[1][2][4]
A browser-centered workflow
The library fragments content into pages and presents the result in a browser, allowing a designer to inspect the layout with familiar browser tools. Its polyfill approach implements selected print-oriented behavior on top of browser rendering rather than replacing the entire browser engine. This workflow can be useful for documents authored as HTML, but should not be confused with importing an arbitrary desktop-publishing project.[1]
Preparing content before pagination
The repository exposes a Previewer interface and a polyfill that normally starts after the document is ready. Applications can delay that start with an asynchronous preparation step or invoke pagination explicitly. Handler hooks also allow custom work during parsing and layout. These controls matter when content needs preparation before pages are formed; changing the input after pagination is a separate concern from producing a completed preview.[2]
Generated navigation content
CSS-generated content can add labels, counters and printed link text without placing those strings directly in the source content. Paged.js's documentation connects this approach with running headers, page numbers and cross-references for paginated documents. Such layout-generated material belongs to the output presentation. A reusable content source and its final paginated reading aids should therefore be treated as related but distinct artifacts.[3]
Command-line rendering and resources
The associated command-line project combines Paged.js with Puppeteer to render HTML as PDF. It exposes options for timeouts, page dimensions, additional scripts and controlling access to local or remote resources. This makes browser automation part of the production environment. The documented controls provide configuration choices, not proof that an untrusted document is safe under every default deployment.[4]
Substitution considerations
Paged.js can substitute for WeasyPrint for compatible HTML/CSS publishing jobs when a browser-based preview and rendering workflow is desired. WeasyPrint uses its own Python pagination engine, so matching the input language does not imply matching layout, dependencies or extension behavior. A switch should compare the required print features and actual output, retaining control of when pagination begins and which resources the renderer may access.[1][2][4][5]
Capabilities & limitations
Browser pagination preview
supportedPaginates HTML using a browser and supported paged-media transformations.[1]
Browser-based HTML/CSS pagination and PDF production · Web browsers, Node.js CLI with Puppeteer · Version, build and integration requirements apply
1 source · check evidence
Browser pagination, preview, polyfill and MIT license
vendor · checked 2026-10-07Pagination timing control
supportedAutomatic start can be delayed by a promise or disabled for explicit preview initiation.[2]
Browser-based HTML/CSS pagination and PDF production · Web browsers, Node.js CLI with Puppeteer · Version, build and integration requirements apply
1 source · check evidence
Previewer, automatic start control and asynchronous handlers
vendor · checked 2026-10-07Automated PDF output
limitedAssociated CLI uses Puppeteer; browser runtime and resource policy are deployment requirements.[4]
Browser-based HTML/CSS pagination and PDF production · Web browsers, Node.js CLI with Puppeteer · Version, build and integration requirements apply
1 source · check evidence
Puppeteer PDF output, timeouts and resource access options
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
WeasyPrint for Browser-based HTML/CSS pagination and PDF production
limitedCan cover suitable HTML/CSS-to-PDF pagination through browser technology; runtime and supported layout behavior differ.[1][4][5]
Web browsers, Node.js CLI with Puppeteer · Version, build and integration requirements apply
References
- Paged.js overview
Browser pagination, preview, polyfill and MIT license
vendor · retrieved 2026-10-07 - Paged.js repository
Previewer, automatic start control and asynchronous handlers
vendor · retrieved 2026-10-07 - Paged.js generated content
Counters, generated text and paged navigation content
vendor · retrieved 2026-10-07 - Paged.js command-line renderer
Puppeteer PDF output, timeouts and resource access options
vendor · retrieved 2026-10-07 - WeasyPrint engine overview
Separate Python HTML/CSS pagination engine
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 291 | 2026-10-11 19:39:43 | /* wbeditentity-create-item:0| */ sf:6f3f5559-73a7-451b-a3fc-c178f5236867:v1 | Add Paged.js with browser preview, asynchronous pagination hooks and separate CLI resource controls; documentation research only. | attribution: /proposals/6f3f5559-73a7-451b-a3fc-c178f5236867 |