[VS-NfD] Put the classification into the Gotenberg PDF header/footer template #208

Closed
opened 2026-07-30 01:43:42 +02:00 by fable-5 · 1 comment
Collaborator

Plan reference: 20-massnahmenplan.md -> P1-2 (output channels)
ADR: ADR 0022
Effort: S (1 AT)
Depends on: #204

Context

Server-side PDF is the export an authority is most likely to file or
forward, so it must be marked per page rather than once at the top.

Current state

  • apps/api/src/import-export/pdf-html.ts builds the export HTML: a
    document-level <header class="pdf-header"> with pond name and title
    (:76–79) plus print CSS for page size and breaks (:30–31, :69–71).
    This header appears once, not per page.
  • Page numbers already come from Gotenberg's footer (:31), so the
    per-page mechanism exists and is the place to extend.
  • Renderer: apps/api/src/import-export/gotenberg.renderer.ts.

Acceptance criteria

  • Classification is rendered in Gotenberg's header and footer template
    so it appears on every page of the PDF, next to the existing page
    numbers.
  • The document-level header keeps working; unclassified pages produce
    an unchanged PDF (asserted against the existing PDF fidelity
    snapshots).
  • Fidelity test extended per the repo's fixture-first process
    (fixtures/README.md): fixture first, snapshot regenerated only with
    the pinned tool version, committed together.
  • Documented in #228.

Out of scope

DOCX/ODT (#209) and browser print (#207).

**Plan reference:** `20-massnahmenplan.md` -> P1-2 (output channels) **ADR:** ADR 0022 **Effort:** S (1 AT) **Depends on:** #204 ## Context Server-side PDF is the export an authority is most likely to file or forward, so it must be marked per page rather than once at the top. ## Current state - `apps/api/src/import-export/pdf-html.ts` builds the export HTML: a document-level `<header class="pdf-header">` with pond name and title (`:76–79`) plus print CSS for page size and breaks (`:30–31`, `:69–71`). This header appears **once**, not per page. - Page numbers already come from Gotenberg's footer (`:31`), so the per-page mechanism exists and is the place to extend. - Renderer: `apps/api/src/import-export/gotenberg.renderer.ts`. ## Acceptance criteria - [ ] Classification is rendered in Gotenberg's header and footer template so it appears on every page of the PDF, next to the existing page numbers. - [ ] The document-level header keeps working; unclassified pages produce an unchanged PDF (asserted against the existing PDF fidelity snapshots). - [ ] Fidelity test extended per the repo's fixture-first process (`fixtures/README.md`): fixture first, snapshot regenerated only with the pinned tool version, committed together. - [ ] Documented in #228. ## Out of scope DOCX/ODT (#209) and browser print (#207).
fable-5 added this to the M26 — VS-NfD: classification metadata milestone 2026-07-30 01:43:42 +02:00
fable-5 added the
area:export
effort:S
vs-nfd:blocker
vs-nfd
labels 2026-07-30 01:43:42 +02:00
Author
Collaborator

Done in PR #267 (commit c2df7c0, CI runs 548+549 green, fast-forward merged on Stefan's standing merge instruction).

Evidence:

  • Classified PDF exports carry the marking via Gotenberg's per-page header/footer templates: bold centered running header + marking next to the existing page numbers in the footer, on EVERY page.
  • The marking travels as conversion-job option {marking} (set only for classified pages); the worker hands it to the renderer.
  • Unclassified pages send exactly the pre-#208 forms - unchanged PDF, pinned by the fidelity smoke (no marking anywhere) and a lastMarking=null unit assertion.
  • New real-Gotenberg fidelity test (pinned gotenberg:8): multi-page marked render shows the marking twice on every page while the document-level header keeps working - verified locally, runs in the CI fidelity gate.
  • Doc convention recorded on #228.
Done in PR #267 (commit c2df7c0, CI runs 548+549 green, fast-forward merged on Stefan's standing merge instruction). Evidence: - Classified PDF exports carry the marking via Gotenberg's per-page header/footer templates: bold centered running header + marking next to the existing page numbers in the footer, on EVERY page. - The marking travels as conversion-job option {marking} (set only for classified pages); the worker hands it to the renderer. - Unclassified pages send exactly the pre-#208 forms - unchanged PDF, pinned by the fidelity smoke (no marking anywhere) and a lastMarking=null unit assertion. - New real-Gotenberg fidelity test (pinned gotenberg:8): multi-page marked render shows the marking twice on every page while the document-level header keeps working - verified locally, runs in the CI fidelity gate. - Doc convention recorded on #228.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#208
No description provided.