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.
What?
This PR adds support for separation colors in PDF-LIB, and answers the following issue request: #444
Code sample:
Why?
Spot colors are used in professional printing, to add colors or effects that cannot be reproduced with traditional CMYK processes. For example:
How?
The PDF specification, section 8.6.6.4, specifies how to embed and use Separation color spaces. This PR consists in 3 parts:
PDFSeparation
, that can be embedded in the document, and add a method inPDFDocument
that allows for embedding said object.PDFPage
that allows to reference a previously-embeddedPDFSeparation
into the page's resources (Resource of type ColorSpace, see section 7.8.3). Such method returns a new type of Color, which can be used only in the given page.cs
andCS
operators prior to setting the ting)Testing?
Unit tests were for the new methods.
This PR was tested by generating a new PDF and editing an old PDF to add a text using a Separation color.
In Adobe Pro, the Separation layer is clearly visible in Output Preview as a distinct layer, and is also displayed on screen using its alternate color.
The generated PDFs are displayed property in Chrome, Firefox, Adobe PDF Pro and Foxit Reader.
The integration test suites for node, deno, browser were run and no visual issue was found.
New Dependencies?
No new dependencies.
Screenshots
Suggested Reading?
Yes
Anything Else?
No
Checklist