Inspiration

A community workshop guide should be easy to turn into a small booklet. Yet ordinary PDF page order is not booklet print order: the last page belongs beside the first, and an incorrect duplex setting can leave the back upside down. FoldSheet makes that arrangement visible before a full print run. Its starting point is a proposed use case for clubs and community workshops, rather than an interviewed customer or measured paper-saving claim.

What it does

Open a local PDF or the fictional 12-page workshop sample. FoldSheet adds blanks to the next multiple of four, arranges pages into nested sheets, and previews the actual two-page print spreads. Choose any sheet and inspect its front or back; adjust A4 or Letter landscape paper, margins from 0 to 20 mm, and 180-degree back-side rotation. Export uses the same PDF bytes shown in the preview.

For the sample, three sheets contain all twelve pages. The outer sheet pairs 12/1 on the front and 2/11 on the back. The remaining sheets pair 10/3 with 4/9, then 8/5 with 6/7. A complete ordering table provides a text alternative to the visual preview. A separate two-sided calibration PDF helps check a printer's duplex orientation before printing the booklet.

Documents stay in the browser: no account, backend, analytics, model API, or runtime upload is required. Original file bytes remain unchanged, and document bytes are not stored in localStorage.

How it was built

The static application uses modular JavaScript, HTML, CSS, pdf-lib 1.17.1, and PDF.js 5.6.205. A pure planner calculates the page pairs. A PDF adapter embeds each page's visible content, preserves its aspect ratio and source rotation, and centers it within its print cell. The controller renders the resulting PDF and keeps those same bytes for export. Both libraries and their licenses are included locally.

Challenges and validation

The difficult part was making the page plan, preview, and exported document agree. Thirteen Node tests passed, covering every supported page count from 1 to 64, fold reconstruction, blank placement, invalid settings, aspect ratio, original-byte preservation, and calibration output. A four-page fixture exercised 0-, 90-, 180-, and 270-degree rotation with cropped page boundaries; source pages and imposed output were rendered and visually compared.

Browser checks covered import, front/back selection, rotation, download, and recovery after rejecting an encrypted PDF. They also exposed a stale-export bug when a margin changed. The controller now disables export immediately and regenerates the preview before enabling it again. Error and recovery states were verified, alongside desktop and mobile layouts.

AI use and limitations

OpenAI Codex authored the original concept, specification, code, fictional samples, copy, and tests under the entrant's direction. AI assistance is disclosed; this is not claimed as unaided human authorship. No generated images, sponsor credits, or paid API calls were used.

FoldSheet is a working prototype, limited to 1–64 pages and 20 MiB. Malformed, encrypted, annotated, and interactive PDFs are unsupported. It cannot detect printer feed direction or guarantee physical results. Tests on controlled fixtures do not establish compatibility with every PDF or printer.

What's next

Test the calibration sheet and a complete booklet on an actual duplex printer, then run a small, consented workshop-organizer trial. Measure setup effort and incorrect print runs before claiming impact. Explore smaller signature groups for thicker booklets.

Built With

Share this project:

Updates