- Shipped
- 6 Agosti 2026, 00:38 UTC
- Author
- Kamo
- Commit
- 857a681
The designer has always offered page rotate, delete, reorder and add-blank, plus watermark, page-number and label modifiers, and the flatten read none of it: it stamped field values onto the source pages and appended certificates. A page you deleted still shipped, a watermark you configured never appeared. All of it is now applied. The pipeline composes in the order a reader's expectations require — blank pages inserted so the design's index space matches the document, each page turned, behind-modifiers drawn, field values stamped, above-watermarks drawn, deleted pages dropped and the rest reordered, certificates appended last. Certificates carry no page number or watermark: they are the audit record of the document, not part of it. Page numbering is resolved against the finished sequence, so a document that drops a page numbers its survivors 1..n rather than leaving a gap. The designer now resolves that sequence identically (kamo-internal pageSequence.ts mirrors EsignPageLayout, case for case) so the preview cannot promise a number the delivered document will not carry. Modifiers are placed against the page as the reader sees it, which on a turned page means mapping display coordinates back into user space and pre-turning the content so it does not come out sideways — EsignPageFrame does that, and its four rotations are pinned by corner tests. Watermarks use the org's own logo from the theme bucket. Most orgs hold SVG only and PDFBox draws rasters, so SVG is transcoded through Batik with external resource loading refused — an uploaded logo is tenant-supplied content and rasterizing is not sanitizing. An org with no logo gets no watermark; the platform's default mark is never substituted onto a tenant's agreement. Hardening throughout: design JSON is parsed totally, so anything malformed, out of range or from a newer designer is dropped rather than thrown and the signatures still land. Deleting every page is refused — PDF has no valid zero-page form and an agreement with no pages is not a document. Inherited page attributes are pinned before the page tree is restructured. A field on a deleted page is not stamped onto some other page. Text keeps its accents instead of being flattened to ASCII, per character, against what the font can encode. 59 tests, 17 of them driving real PDFBox end to end and reading the result back.