2.7 KiB
2.7 KiB
dompdf Investigation Requirement
Document Context
This investigation requirement is governed by requirements/environment.md and requirements/top-level.md.
No fallback behavior is permitted without explicit instruction.
Purpose
Determine whether dompdf is suitable for generating production-quality mailshot PDFs from the sample templates:
samples/renewal_draft.htmlsamples/invoicing.html
Inputs
- Template sources:
samples/renewal_draft.htmlsamples/invoicing.html
- Representative field values for all template tokens.
- FECA logo asset content equivalent to
pdf_asset('FenEdgeLogoOrange').
Investigation Route
-
Render-ready normalization
- Produce render-ready HTML for each sample by replacing template tokens/macros with fixed test data.
- Ensure
pdf_asset('FenEdgeLogoOrange')resolves to concrete HTML/image content.
-
dompdf spike execution
- Provide an executable spike script in
working/codex-spikes/(agent artefacts, not user operational scripts) that:- loads each normalized template,
- renders via dompdf,
- writes PDFs to
working/, - fails with non-zero exit code on render errors.
- Provide an executable spike script in
-
Structured suitability checks
renewal_draft.htmlchecks:- watermark (
position: fixed,transform, transparency) - table borders, spacing, and mm-based layout
- logo placement and title/header integrity
- watermark (
invoicing.htmlchecks:- line-break behavior from macro expansion
- currency/symbol rendering (
£,✉,☎) - emoji contact symbols such as
📞/📧must be normalized to PDF-safe symbols (☎/✉) and pinned toDejaVu Sansbefore Dompdf rendering. - spacing, wrapping, and pagination
-
Baseline comparison
- Generate browser print-to-PDF baselines for both templates.
- Compare dompdf output to browser baseline using a fixed checklist.
-
Decision criteria
Suitable: all critical checks pass with no blocking defects.Suitable with constraints: non-blocking defects exist; template constraints/workarounds are documented.Not suitable: one or more blocking defects remain.
-
Contingency (only if explicitly instructed)
- Evaluate one alternative renderer against the same inputs/checklist for comparison.
Deliverables
- Rendered HTML artefacts for both sample templates.
- dompdf-generated PDFs for both sample templates.
- Completed suitability checklist with pass/fail evidence.
- Recommendation outcome: suitable / suitable with constraints / not suitable.
- Documented required template constraints (if any).
Execution Notes
- Investigation outputs should be isolated under
working/. - Any generated test artefacts must be cleaned up by the test process when they are no longer needed.