Skip to content

A4 print-sheet preview#22

Merged
ankitsejwal merged 5 commits into
mainfrom
feat/a4-preview
Jun 28, 2026
Merged

A4 print-sheet preview#22
ankitsejwal merged 5 commits into
mainfrom
feat/a4-preview

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

Implements #6 — a live A4 sheet preview showing the polaroids laid out as they'll print.

  • New shared lib/layout.ts (A4 in mm, polaroid ratios, grid sheetLayout(perRow)) — the single source of truth the PDF export (sRGB PDF export (pdf-lib) #8) will also use, so preview and PDF stay in sync.
  • SheetPolaroid renders proportionally to its cell (frame/image/captions scale together).
  • A4-proportioned sheet, scales to viewport via ResizeObserver, dashed printable-margin guide, honours the selected caption font.
  • Overflow beyond one sheet is flagged (multipage is Multipage support #9).

Decision: DOM instead of Konva

The issue suggested Konva, but I went DOM/CSS: it reuses the proven polaroid rendering (captions + bundled fonts + images just work — no canvas font-loading pitfalls), it's print-accurate, and the layout is a structured grid that never needs a freeform canvas. Drag-reorder (#10) will use DOM dnd. Lower risk and easier to keep pixel-matched to the PDF.

pnpm lint/typecheck/build green. (Visual check pending — browser profile was locked by an active session; the shared layout gets validated headlessly via the #8 PDF render.)

Closes #6

@ankitsejwal ankitsejwal merged commit 74f30ef into main Jun 28, 2026
1 check passed
@ankitsejwal ankitsejwal deleted the feat/a4-preview branch June 28, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A4 preview canvas (Konva)

1 participant