Skip to content
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

Supporting Spot Colors #756

Open
ziaenezhad opened this issue Dec 12, 2017 · 11 comments
Open

Supporting Spot Colors #756

ziaenezhad opened this issue Dec 12, 2017 · 11 comments

Comments

@ziaenezhad
Copy link

ziaenezhad commented Dec 12, 2017

Hi pdfkit,
i implemented support of spot colors in my fork:
ziaenezhad@6cbbeef

@tonyduanesmith
Copy link

Just testing, this is awesome!

@mlgoff59
Copy link

I have no problems admitting my ignorance. Or lack of skill. I have no idea how to use this feature based on the diffs in your commit.

We have an app that generates SVG files. It includes some custom SPOT tags that we created.

Do you have a JavaScript example showing how to actually use the SPOT support?

@ziaenezhad
Copy link
Author

Hi @mlgoff59
first because the main repo doesn't maintain anymore, you should add my forks to your project:

"pdfkit": "github:sajjad-shirazy/pdfkit.js",
"svg-to-pdfkit": "github:sajjad-shirazy/SVG-to-PDFKit#0.1.8",

in your code:

const doc = new PDFDocument();
// adding spot colors
doc.addSpotColor('RDG_GLOSS', 50, 25, 25, 0);
doc.addSpotColor('RDG_WHITE', 25, 25, 25, 25);

and in your svg:

<rect fill="RDG_GLOSS" width="300" height="100"/>
<path fill="RDG_GLOSS" d="M150 0 L75 200 L225 200 Z" />
<text fill="RDG_WHITE" x="0" y="15">TEST</text>

@mlgoff59
Copy link

mlgoff59 commented May 24, 2018

Thank you for the quick response.

I assume that instead of RDG colors I could use CYMK:

doc.addSpotColor('CYMK', 100, 96, 0, 10);

Is that correct?

Okay, my ignorance is showing. I just learned that CYMK is not SPOT colors. the question would be better stated, "Am I required to use Roland DG color palettes?"

You know I think I just figured it out. Sorry to bother you.

@emmansayson
Copy link

devongovett can this be added to main repo? Thanks :)

@mlgoff59
Copy link

mlgoff59 commented Feb 8, 2019

Note that if you are using Pattern Dictionaries, SPOT will not work. the pattern dictionaries are imcompatible with the SPOT color spaces. See Postscript Langauge Ref 3 section 5 for more details.

@naretini
Copy link

@sajjad-shirazy still it's not clear to me on how we're supposed to use your fork., to have addSpotColor functionality available.

@devongovett any chance that you'll add spot color support to the official repo?

@ziaenezhad
Copy link
Author

@naretini, unfortunately, pdfkit doesn't maintain anymore, if you want to use my fork, add these lines to the dependencies within your package.json:

    "pdfkit": "github:sajjad-shirazy/pdfkit.js",
    "svg-to-pdfkit": "github:sajjad-shirazy/SVG-to-PDFKit#0.1.8",

and then:

npm install

@naretini
Copy link

naretini commented Feb 5, 2020

@sajjad-shirazy thanks.
I'm experiencing some issue with your fork. It apparently work but sometimes ( when I create multiple page pdf having inside multiple vector paths using spotColors (addSpotColor(spotColorName, C, M, Y, K) and stroke using stroke(spotColorName) )
It creates an apparently valid pdf file with the correct number of pages but one of the page is corrupted, cant be viewed: no vector path is draw and if I try to open that page with Acrobat or Illustrator I get an error like: "Acrobat PDF FileFormat is having difficulties. Expected a stream object"
The above error happens randomly, and looks like more like an async issue rather than a static error, since on same process, same values, sometimes it creates the full pdf sometimes it miss a page.

OT: Since pdfkit doesn't maintain anymore. Do you know any alternative (still maintained) nodejs (npm) package that supports vector graphics and spot colors?

@ulfaslak
Copy link

ulfaslak commented Aug 24, 2021

This should be a high-priority issue. It is such an important feature for anyone that does anything with printing and cutting technology*.

(*) It is important for multiple reasons. Two main ones are: (1) to print PANTONE colors (beyond RGB and CMYK), and (2) to define curves that should not be printed but have some other function (like cut-curves).

@Zaggo34
Copy link

Zaggo34 commented Feb 16, 2024

I'm trying to use this fork to specify some SVG cut-curves that should not be printed. These need to be labelled with Lab Spot colour (not RGB or CMYK). @ziaenezhad is that possible with this fork? If so, could you kindly show me how I would use it for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants