nigig-org/crates/apps/pdf/pdf-document/tests
andodeki 0bef30a6d5
Some checks failed
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
feat(pdf): compositing and overprint — the blend maths had no backdrop
`transparency.rs` implemented all sixteen blend modes and unit-tested them
against the specification's formulas. Nothing ever called them with a
backdrop. The Makepad renderer's `SetBlendMode` pushed a
`TransparencyError::Unsupported` and then painted the source colour, so a
/Multiply highlight and a /Normal one produced byte-identical output and
every test passed — because every test asked "was the right command
issued", not "does the page look right".

Overprint had no code at all. /OP, /op and /OPM were not parsed, so an
overprinting object knocked out the inks under it. That is not a missing
feature, it is the inverse of the instruction: on a press it is the
difference between a colour and a hole.

- `composite.rs`: a straight-alpha RGBA `Canvas` implementing §11.3.6's
  union formula, weighted by backdrop alpha so a Multiply over transparency
  is the source rather than black. Constant alpha and per-pixel soft masks.
  Transparency groups composite as a unit; knockout groups are refused by
  name rather than silently treated as non-knockout.
- Overprint as `composite_cmyk`, separate from the RGB path rather than a
  flag on it: overprint is a statement about inks and RGB has none. /op
  defaults to /OP per table 58 — defaulting it to false makes the common
  `<< /OP true >>` knock out every fill. §10.7.5's "no effect on an RGB
  device" is asserted, so our doing nothing there is the spec rather than
  an omission.
- `raster.rs`: a CPU rasteriser that replays a command list onto a canvas.
  Not on the display path, no anti-aliasing, no fonts; it exists so
  compositing has a verifiable output. In pdf-graphics and not pdf-makepad
  because a test that needs a GPU is a test that does not run.
- Golden **pixels** for shading, mesh, blend and overprint pages — Phase
  7's exit criterion, which the Phase 2 command-text goldens cannot meet.
  ASCII grids with a colour legend, quantised to quarter steps; each test
  asserts its exact colours before comparing, so a wrong-but-stable render
  cannot be blessed by an UPDATE_GOLDEN run.

Six mutations, all killed, including the two that describe the old
behaviour: discarding the blend result, and ignoring the overprint flag.

1364 tests pass. ADR 0030.
2026-08-18 19:25:15 +00:00
..
acroform.pdf feat(pdf): complete Phase 2 render pipeline with golden tests 2026-07-27 15:55:53 +00:00
acroform_roundtrip.rs feat(pdf): complete Phase 3 document model with real form state 2026-07-27 15:49:46 +00:00
annotation_roundtrip.rs fix(pdf): fuzz every target, and close two ADR 0004 gaps 2026-07-31 18:34:25 +00:00
catalog_edit_roundtrip.rs feat(pdf): outline, page label and struct-tree editing — Phase 5 complete 2026-08-17 12:26:29 +00:00
cert_helpers.rs fix(pdf): security review of the signing code — a forgery verified as valid 2026-08-18 10:39:20 +00:00
color.rs feat(pdf): real colour spaces, ICC profiles and PDF functions 2026-07-28 20:48:55 +00:00
compact_roundtrip.rs feat(pdf): redaction and object compaction — and three reader defects 2026-08-17 12:20:25 +00:00
content_roundtrip.rs feat(pdf): content-stream serialiser and editor — the Phase 5 foundation 2026-08-17 10:29:39 +00:00
corpus.rs feat(pdf): complete Phase 6 testing infrastructure 2026-07-27 17:08:23 +00:00
declared_resources.rs test(pdf): assert what a file declares is delivered, and floor the coverage 2026-08-16 19:04:57 +00:00
destinations.rs feat(pdf): internal links that actually go somewhere 2026-08-16 19:34:01 +00:00
encryption.rs test(pdf): prove the AES-256 path and harden malformed encryption 2026-07-28 17:50:44 +00:00
encryption_write.rs feat(pdf): encryption on save — AES-128 and AES-256 (Phase 6, part one) 2026-08-18 07:27:45 +00:00
filters.rs fix(pdf): main was red — three clippy errors broke the engine build 2026-08-18 05:41:22 +00:00
flatten_roundtrip.rs feat(pdf): flatten annotations and form fields into page content 2026-08-17 12:03:59 +00:00
form_actions.rs feat(pdf): AcroForm actions and validation; JavaScript refused, not run 2026-07-31 22:41:50 +00:00
jpeg_images.rs feat(pdf): a real JPEG decoder — the old one was a stub returning black 2026-08-16 18:33:56 +00:00
page_ops_roundtrip.rs feat(pdf): page operations — insert, reorder, duplicate, delete, import 2026-08-17 10:38:55 +00:00
phase7_exit_criterion.rs feat(pdf): transparency, and four operator-parsing bugs it exposed 2026-07-31 18:58:31 +00:00
redact_roundtrip.rs feat(pdf): redaction and object compaction — and three reader defects 2026-08-17 12:20:25 +00:00
revisions.rs test(pdf): harden the xref revision chain 2026-07-28 16:58:16 +00:00
robustness.rs feat(pdf): complete Phase 6 testing infrastructure 2026-07-27 17:08:23 +00:00
save_roundtrip.rs feat(pdf): implement incremental save (Phase 8) 2026-07-28 16:35:22 +00:00
sign_document_roundtrip.rs feat(pdf): the five Phase 6 bullets the status line omitted 2026-08-18 12:06:59 +00:00
signatures.rs feat(pdf): read signatures, and fix a third ObjRef-destroying resolve 2026-07-31 20:02:29 +00:00
signing_profiles.rs test(pdf): close the two real coverage gaps in the signing module 2026-08-18 17:08:11 +00:00
signing_roundtrip.rs fix(pdf): security review of the signing code — a forgery verified as valid 2026-08-18 10:39:20 +00:00
signing_security.rs fix(pdf): security review of the signing code — a forgery verified as valid 2026-08-18 10:39:20 +00:00
structure.rs feat(pdf): tagged structure tree, and the BMC bug that turned red green 2026-07-31 22:19:45 +00:00
transparency.rs feat(pdf): compositing and overprint — the blend maths had no backdrop 2026-08-18 19:25:15 +00:00
type3_and_streaming.rs feat(pdf): Type 3 fonts and streaming interpretation — Phase 2 complete 2026-08-16 17:28:44 +00:00
xref_streams.rs feat(pdf): read xref streams and object streams (PDF 1.5+) 2026-08-16 17:10:42 +00:00