mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-01 14:08:23 -06:00
Review of #2815 (FredApps): two ways the detector took real content for a page's own white backdrop and replaced it by default. - A `gs` sets only the keys its dictionary has, but each one replaced the whole opacity decision and read every key it left out as its default, so `/Transparent gs /LineOnly gs 1 g ... re f` (ca 0.5, then only a line width) counted as opaque. Fill alpha, soft mask and blend mode are now kept one by one, through `gs` and `q`/`Q`. - A transfer function was never read: TR or TR2 mapping 1 to 0 paints `1 g` black, and the fill was still replaced. The transfer function is tracked too, TR2 over TR in the same dictionary, and only /Identity (and /Default for TR2) counts; anything else leaves the fill alone. Tests: nine graphics states that must keep the fill (each also checks Add Background leaves the content as it was) and nine that still find the backdrop (keys set back, TR2 /Default over a TR function, q/Q restoring), plus an end-to-end render of the reviewer's translucent case under a red background. All the keep cases fail on the code before this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>