-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Separation colors #1322
base: master
Are you sure you want to change the base?
Conversation
23a0801
to
c52af89
Compare
What's the status on this PR? I think this is a great addition to pdf-lib, we desperately need this. Thank you. |
Sadly, there does not seem to have been any activity from the core PDF-Lib maintainers for more than one year. For now, we maintain our own fork of this library (@ecervo/pdf-lib) until PRs start to be processed again, or a new fork starts to gain traction. |
Thank you very much for your reply. Is your fork a private repo? |
Thank you very much! |
hi, is there any chance this get merged? |
@phipla Thank you. Your fork saved me from having to find another library. The overprint was especially nice and important. |
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