Skip to content

Export print-ready sRGB A4 PDF#24

Merged
ankitsejwal merged 3 commits into
mainfrom
feat/pdf-export
Jun 28, 2026
Merged

Export print-ready sRGB A4 PDF#24
ankitsejwal merged 3 commits into
mainfrom
feat/pdf-export

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

Implements #8 — one-click print-ready PDF of the polaroids.

  • lib/pdf.ts builds an A4, multipage PDF with pdf-lib, using the shared lib/layout.ts so it matches the on-screen preview (A4 preview canvas (Konva) #6).
  • Images are centre-cropped and rasterized to sRGB JPEG via canvas — handles any format the browser can decode, and sRGB is exactly what photo labs / home inkjets (incl. the Canon G1010) want. No CMYK (deliberate — see README/research).
  • 300 DPI image cells, white frames, dashed margin guide, centered captions; "Export PDF" button on the preview downloads polaroids.pdf.

Verification (headless)

Prototyped the identical layout + pdf-lib drawing and rendered the PDF to PNG — A4 size confirmed (595.3 × 841.9 pt), 3-per-row grid, real photos embedded, captions + margin guide correct. lib/pdf.ts reuses the same lib/layout.ts math. pnpm lint/typecheck/build green.

Follow-up

Captions render in Helvetica (vector, crisp); matching the handwriting font in the PDF needs font embedding — tracked in #23.

Closes #8

@ankitsejwal ankitsejwal merged commit 0142f20 into main Jun 28, 2026
1 check passed
@ankitsejwal ankitsejwal deleted the feat/pdf-export branch June 28, 2026 12:58
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.

sRGB PDF export (pdf-lib)

1 participant