SVG-to-PDFKit
SVG-to-PDFKit copied to clipboard
Supporting Spot Colors
Supporting Spot Colors: https://github.com/alafr/SVG-to-PDFKit/pull/62/commits/562a3a6a1d74e63f38398b7043dc02df3bd9f74c
I will consider merging this, when and if it gets supported in the official PDFKit repository... There are conflicts mostly because of the different indentation in your file (you will have to remove the 'formatting' commits - but no need to hurry, merging in PDFKit can take quite a long time)
Hi @alafr , seems that the writer of PDFKit does not maintain the repo any more. i suggest you to pull spot colors into your fork. is it possible?
Hi,
I commented some changes (mostly in the PDFKit part) that could me made to make the code cleaner and more similar to the existing PDFKit code.
Are the spotColors
anything more than CMYK which is already supported by PDFKit and SVG-to-PDFKit?
Yes, they are custom named CMYK colors, which are using in printing special layers, for example emboss UV printing, etc. which deals directly with the printer.
using my codes we can set fill
of a path
or rect
to those values:
<path fill="RDG_GLOSS" d="M90,0L50,40L10,0H0l50,50l50-50H90z M80,0H70L50,20L30,0H20l30,30L80,0z M60,0H40l10,10L60,0z M0,100h10l40-40l40,40h10 L50,50L0,100z M20,100h10l20-20l20,20h10L50,70L20,100z M40,100h20L50,90L40,100z M100,90V80L70,50l30-30V10L60,50L100,90z M100,70 V60L90,50l10-10V30L80,50L100,70z M0,10v10l30,30L0,80v10l40-40L0,10z M0,30v10l10,10L0,60v10l20-20L0,30z"></path>
the color should register before:
doc.addSpotColor('RDG_GLOSS', 50, 25, 25, 0);
Hi,
I extracted this feature to our own fork: https://github.com/alvarcarto/SVG-to-PDFKit/. The implementation was re-done, adding the latest commits from master branch as well.
Comparison here: https://github.com/alafr/SVG-to-PDFKit/compare/master...alvarcarto:feature/spot-colors?expand=1
You can use the spot colors by adding to your package.json:
"pdfkit": "git://github.com/alvarcarto/pdfkit.git#build",
"svg-to-pdfkit": "git://github.com/alvarcarto/SVG-to-PDFKit.git#feature/spot-colors",