Repository navigation
Add print previews with poster overlap and booklet layouts - #46
Conversation
|
Thanks for the poster tiling and booklet work. We’ve approved the feature with a simpler default and pushed the maintainer changes directly to this PR in e206e3f. Basic opens first. The preview takes the dimensions of the page you’re viewing. Print… sends the complete annotated PDF to the system dialog, where you choose the printer, pages, and copies. Advanced has poster tiling, booklet layouts, multiple pages per sheet, scaling, and output quality. The build and off-screen smoke suite passed on Windows, macOS, and Linux. The regression checks that Basic hands off all 101 pages byte-for-byte, that a saved signature reaches the print snapshot, and that the preview fits portrait, landscape, and 11 × 17 pages. Native printer calls were intercepted. The after screenshots are After screenshots and recording · Original print setup screenshots · Windows, macOS, and Linux validation Maintainer implementation and verification with GPT-6 in Codex Desktop. |




Problem
Folio's desktop Print command sends the current PDF directly to a hidden browser frame. It does not provide an in-app sheet preview or controls for poster tiling, booklet imposition, multiple pages per sheet, or output resolution. Users cannot inspect those layouts before continuing to the system print dialog.
Change
Add a desktop print-setup dialog, opened from More > Print or the platform's Print shortcut. It uses an annotated snapshot, respects reordered pages, and preserves the document's unsaved marker. The browser edition retains its existing print path.
Print controls and preview
Page sizing and handling
Output quality and resource handling
silent: false.Deliberate limits
Usage, implementation limits and test commands are documented in
docs/printing.md. No new dependency, version bump, changelog entry, installer, generated PDF, screenshot or machine-specific path is included in the commit.Issue or approval
This is a contributor-requested draft for upstream scope review. No upstream issue or maintainer approval comment has been obtained.
CONTRIBUTING.mdrequires agreement on new features before implementation; this draft does not claim that approval and should remain a draft pending maintainer feedback.How I checked it
Tested on Windows 11 x64, with Node.js 24.19.0 and Electron 45.1.0. macOS and Linux have not been tested locally.
npx tsc --noEmitnode scripts/test-print.mjs: page ranges, sizing, poster coverage and exact-fit tile counts, booklet ordering/padding, DPI dimensions, resource limits, PNG validation and inch/mm conversion.npm run buildnpm run smoke: existing Windows reader regressions, including preservation of unsaved annotations while preparing/cancelling a print snapshot.node scripts/smoke-print.mjs: hidden desktop interaction tests for ranges, focus, DPI/overlap controls, invalid input and memory-limit errors, preparation cancellation, and native print handoff. Generated Multiple and Booklet PDFs have the expected sheet counts and paper dimensions; the four-sheet 600 dpi poster PDF contains 5,100 × 6,600-pixel page images.node scripts/smoke-print-resolution.mjs: actual PDF rasterization at all three DPIs, effective source viewport scale beyond the former 6,000-pixel cap, cropped canvas allocation, preview geometry, encoding and cancellation. Adjacent tiles had zero mismatched pixels in the tested overlap strips at 150, 300 and 600 dpi.git diff --checkThe print tests intercept native printer calls. No physical print job was submitted. Printer-specific dialogs, physical alignment, duplex behavior and device resolution remain unverified. No merge or release is requested by this draft.
Before/after screenshots show the upstream Print menu and the new Size, Poster and Booklet setup using Folio's bundled sample PDF. They are attached to the PR and are not committed.
Implementation and tests prepared with OpenAI Codex, GPT-6, in the Windows Codex execution environment.