-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 spot colors #1464
base: master
Are you sure you want to change the base?
Conversation
@@ -1,4 +1,4 @@ | |||
import diff from 'jest-diff'; | |||
import { diff } from 'jest-diff'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly related to this PR, but as I was running the tests, my new test initially failed, and I had to change this to make the test error correctly.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi, I think this is highly expected feature. Anyone to resolve conflicts? |
@hubertmuller I've merged the latest from |
@@ -40,7 +40,7 @@ class PDFObject { | |||
static convert(object, encryptFn = null) { | |||
// String literals are converted to the PDF name type | |||
if (typeof object === 'string') { | |||
return `/${object}`; | |||
return /^[/[(\d].*/.test(object) ? object : `/${object}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add unit tests for this change?
What kind of change does this PR introduce?
This adds support for spot colors - see PDF Association and Adobe for details.
A new
PDFDocument.addSpotColor
method has been added:The code was originally written by @ziaenezhad who mentioned it in #756
Then @sekforde submitted #1457 which was closed unmerged.
My code is based on the two contributions above, but I've also added a test, and updated the documentation and changelog. So hopefully this in a more mergable condition.
Checklist: