Browser-based PDF Generator
JSON-configured documents assembled in the browser, with page-budget pagination and Web Worker computations.
- JavaScript
- TypeScript
- html2canvas
- jsPDF
- Web Workers
Documents without a rendering server
Built in December 2025 for a client requirement, this engine assembles multipage documents in the browser. Images, tables, fonts, headers and footers are configured in JSON. There is no visual template editor or public demo.
From template to PDF
I designed the schema, rendering pipeline and available-space pagination. I moved heavy JSON and layout calculations into Web Workers, while browser-side rendering uses html2canvas and jsPDF.
Separate content from page rules
Templates describe pageSize, margins, header, footer, sections and styles. The pagination engine compares an element’s required height with the current page’s remaining budget before placing it. This browser engine is separate from Next Web Business’s server-side QuestPDF integration.
- JSON template and data
- Worker computes layout budget
- Place element or start a page
- Browser renders content
- jsPDF assembles output
Interactive 3D Distributed Systems Graph
Live 3D topology visualizing service boundaries, isolation contracts, and asynchronous document rendering pipelines.
Web Client
Next.js 16 · React 19HTTPS / WSS · 120fps GSAPApp Router RSC with client-side interactive leaves and zero-latency audio synthesis.
Handle overflow before placing content
Remaining space accounts for the current vertical position, bottom margin and footer. If an element does not fit, the engine starts a new page and resets the position below the header. Web Workers handle data and layout computations so that this work does not all occupy the main thread.
remainingSpace = pageHeight - (currentY + bottomMargin + footerHeight)requiredSpace = elementHeight + elementMarginTopif requiredSpace > remainingSpace: finalizeCurrentPage() startNewPage() currentY = topMargin + headerHeightplaceElement(currentY)currentY = currentY + requiredSpaceA qualitative performance story
Document assembly requires no server rendering round-trip. I describe the architecture without inventing rendering-time benchmarks or claiming that every oversized element can be split. The repository and client documents remain private.