Skip to content

Spot colors with spaces does not work #1644

@Comiccobe

Description

@Comiccobe

Bug Report

Description of the problem

Adding a spot color that has spaces inside the name generates a faulty pdf that does not open in Illustrator. Replacing the spaces with underscores does work but that does not match the names pantone colors have when designers use it in Illustrator.

Error in Illustrator:

Image

Inkscape opens the file but the rect does not get a color:

Image

Code sample

var PDFKitDocument = require("pdfkit");
var fs = require("fs");
const doc = new PDFKitDocument({
  size: [500, 500],
});
doc.pipe(fs.createWriteStream("output.pdf"));
doc.addSpotColor("PANTONE 295 C", 100, 53, 0, 67);
doc.rect(100, 100, 200, 100).fill("PANTONE 295 C");
doc.end();

Your environment

  • pdfkit version: 0.17.2
  • Node version: 21.7.3
  • Browser version (if applicable): N/A
  • Operating System: macOS 15.3.1 (24D70)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions