PDFBOX-5074: use the tint transform of DeviceN if a spot colorant isn't white at zero tint - #534
Closed
valerybokov wants to merge 2 commits into
Closed
valerybokov wants to merge 2 commits into
valerybokov wants to merge 2 commits into
Conversation
Contributor
|
Yes thanks, this works fine with the 2 files from that issue + the 2 files from the linked GS ticket and no regressions. This includes the Altona test files. |
asf-gitbox-commits
pushed a commit
that referenced
this pull request
Sep 22, 2026
…'t white at zero tint, by Valery Bokov and Claude Code; closes #534 git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/3.0@1938425 13f79535-47bb-0310-9956-ffa450edef68
asf-gitbox-commits
pushed a commit
that referenced
this pull request
Sep 22, 2026
…'t white at zero tint, by Valery Bokov and Claude Code; closes #534 git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1938427 13f79535-47bb-0310-9956-ffa450edef68
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Problem
In PDFBOX-5074 (https://issues.apache.org/jira/browse/PDFBOX-5074), a DeviceN space with one spot colorant (PANTONE 342 C) is painted at tint 0.4. It renders as a dark green (RGB ≈ 0, 0.16, 0.12), so the tint ramp runs from black to green. Adobe Reader draws a white background with a light green fill.
Cause
When a DeviceN has an attributes dictionary, PDDeviceN converts to RGB by multiplying the RGB values of its colorants (toRGBWithAttributes). That only works if a colorant with tint 0 is white, so that no ink leaves the result unchanged.
In this file the spot colorant's Separation function maps tint 0 to black (0,0,0). Multiplying by that darkens everything, and the space ends up black-to-green. The tint transform to the CMYK alternate space gives white at tint 0.
Change
Notes
Per https://www.apache.org/legal/generative-tooling.html: portions of this PR were
produced with assistance from Claude Code (Anthropic), based on a bug was described in Apache PDFBOX Issue Tracker.
I've reviewed the generated code and confirm to the best of my knowledge that the output does not include any
third-party copyrighted material and is compatible with the Apache License 2.0.