{"schemaVersion":"1.0","record":{"label":"Paged.js","description":"JavaScript pagination library for previewing and producing print-oriented documents with browser technology.","aliases":["PagedJS"],"kind":"software","website":"https://pagedjs.org/","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.","license":"MIT","lifecycle":"active","example":false,"features":[{"name":"Browser pagination preview","status":"supported","detail":"Paginates HTML using a browser and supported paged-media transformations.","useCase":"Browser-based HTML/CSS pagination and PDF production","platforms":["Web browsers","Node.js CLI with Puppeteer"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pagedjs.org/en/documentation/1-the-big-picture/","locator":"Browser pagination, preview, polyfill and MIT license","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"}]},{"name":"Pagination timing control","status":"supported","detail":"Automatic start can be delayed by a promise or disabled for explicit preview initiation.","useCase":"Browser-based HTML/CSS pagination and PDF production","platforms":["Web browsers","Node.js CLI with Puppeteer"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://github.com/pagedjs/pagedjs","locator":"Previewer, automatic start control and asynchronous handlers","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"}]},{"name":"Automated PDF output","status":"limited","detail":"Associated CLI uses Puppeteer; browser runtime and resource policy are deployment requirements.","useCase":"Browser-based HTML/CSS pagination and PDF production","platforms":["Web browsers","Node.js CLI with Puppeteer"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://github.com/pagedjs/pagedjs-cli","locator":"Puppeteer PDF output, timeouts and resource access options","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"}]}],"alternatives":[],"slug":"paged-js","draftAlternatives":[{"targetSlug":"weasyprint","status":"limited","detail":"Can cover suitable HTML/CSS-to-PDF pagination through browser technology; runtime and supported layout behavior differ.","useCase":"Browser-based HTML/CSS pagination and PDF production","platforms":["Web browsers","Node.js CLI with Puppeteer"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pagedjs.org/en/documentation/1-the-big-picture/","locator":"Browser pagination, preview, polyfill and MIT license","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"},{"url":"https://github.com/pagedjs/pagedjs-cli","locator":"Puppeteer PDF output, timeouts and resource access options","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"},{"url":"https://doc.courtbouillon.org/weasyprint/stable/","locator":"Separate Python HTML/CSS pagination engine","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"}]}],"evidence":[{"url":"https://pagedjs.org/en/documentation/1-the-big-picture/","locator":"Browser pagination, preview, polyfill and MIT license","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"},{"url":"https://github.com/pagedjs/pagedjs","locator":"Previewer, automatic start control and asynchronous handlers","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"},{"url":"https://github.com/pagedjs/pagedjs-cli","locator":"Puppeteer PDF output, timeouts and resource access options","retrievedAt":"2026-10-07T12:42:28.193Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://pagedjs.org/en/documentation/1-the-big-picture/","locator":"Browser pagination, preview, polyfill and MIT license","retrievedAt":"2026-10-07T12:42:28.193Z","id":"picture","title":"Paged.js overview","kind":"vendor"},{"url":"https://github.com/pagedjs/pagedjs","locator":"Previewer, automatic start control and asynchronous handlers","retrievedAt":"2026-10-07T12:42:28.193Z","id":"repo","title":"Paged.js repository","kind":"vendor"},{"url":"https://pagedjs.org/en/documentation/6-generated-content/","locator":"Counters, generated text and paged navigation content","retrievedAt":"2026-10-07T12:42:28.193Z","id":"generated","title":"Paged.js generated content","kind":"vendor"},{"url":"https://github.com/pagedjs/pagedjs-cli","locator":"Puppeteer PDF output, timeouts and resource access options","retrievedAt":"2026-10-07T12:42:28.193Z","id":"cli","title":"Paged.js command-line renderer","kind":"vendor"},{"url":"https://doc.courtbouillon.org/weasyprint/stable/","locator":"Separate Python HTML/CSS pagination engine","retrievedAt":"2026-10-07T12:42:28.193Z","id":"weasy","title":"WeasyPrint engine overview","kind":"vendor"}],"overviewCitations":["picture","repo","cli"],"licenseCitations":["picture"],"sections":[{"id":"preview","heading":"A browser-centered workflow","paragraphs":[{"id":"preview-detail","content":[{"text":"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."}],"citations":["picture"]}]},{"id":"timing","heading":"Preparing content before pagination","paragraphs":[{"id":"timing-detail","content":[{"text":"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."}],"citations":["repo"]}]},{"id":"content","heading":"Generated navigation content","paragraphs":[{"id":"content-detail","content":[{"text":"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."}],"citations":["generated"]}]},{"id":"automation","heading":"Command-line rendering and resources","paragraphs":[{"id":"automation-detail","content":[{"text":"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."}],"citations":["cli"]}]},{"id":"comparison","heading":"Substitution considerations","paragraphs":[{"id":"comparison-detail","content":[{"text":"Paged.js can substitute for "},{"text":"WeasyPrint","targetSlug":"weasyprint"},{"text":" 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."}],"citations":["picture","repo","cli","weasy"]}]}]},"id":"Q305","revision":291,"updatedAt":"2026-10-11T19:39:43Z","sourceUrl":"https://substitutefor.net/entities/Q305?revision=291"}}