Pack print: A4 upright pages, small pictures at their size, card sides on one sheet
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 43s
CI / release (push) Skipped

Every page of the pack is now A4 upright, so it prints as one stack. A
PDF page or a whole-page picture that lies wider than tall is turned
onto the page (a small one that fits as it is stays as it is), and a
PDF page is only made smaller, never larger.

A picture never prints larger than its resolution allows (the JFIF or
PNG dpi, else 150 dpi), nor larger than its kind's box: passport pages,
visas and stamps 180 x 128 mm, cards 130 x 90 mm, and a phone's
screenshot (the TDAC, or any picture about twice as tall as wide)
150 x 75 mm. These print at the top of the page.

Cards: a new kind "ID card", and the work permit, take two pictures in
one upload as front and back (migration 0008 documents.back_of). The
Documents tab marks them front/back, lists them together and offers
"Print both sides" (.../documents/{id}/sides.pdf); the pack prints both
on one sheet. The client link takes ID cards too. The demo seeds a TDAC
screenshot and an ID card's two sides.

Checks: fmt, clippy, 108 unit and 57 integration tests (print sizes,
dpi reading, the back following its front, the paired upload, its
audit and the sides PDF); the demo pack's pages checked as images.
The Documents tab's actions stack on a phone, so none is cut off.
This commit is contained in:
grabowski committed 2026-11-21 18:30:43 +07:00
1 parent 506221ecd0
commit 1f526f17f9
16 files changed
+724 -73

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
-- The back of a card: an ID card's or a work permit card's two sides are
-- two documents, the back pointing at the front, and they print together
-- on one A4 sheet. Uploaded together, the second file is the back.
ALTER TABLE documents
ADD COLUMN back_of BIGINT UNIQUE REFERENCES documents (id) ON DELETE SET NULL,
ADD CONSTRAINT documents_back_of_other CHECK (back_of <> id);