thegetty / quire

A multi-package repository for the Quire multiformat publishing framework
https://quire.getty.edu/
BSD 3-Clause "New" or "Revised" License
97 stars 12 forks source link

Plain black text is encoded as RGB instead of Gray and so printing with full-color in paged.js #734

Open geealbers opened 1 year ago

geealbers commented 1 year ago

Before proceeding, check to make sure there isn’t an existing issue for this bug.

Steps to reproduce

  1. Start a new project
  2. Run quire build and quire pdf to generate a PDF
  3. Open the PDF in Acrobat and use the Print Production > Output Preview tool to hide the Black (K) separation

Actual behavior

The main body text of the PDF (though set as #000 is revealed to be made up of a full-color build of CMYK. Meaning it has a little of each color in it.

It appears that in Paged.js/Chrome the blacks are being encoded as RGB colors and being interpreted as full CMYK builds and so using 4-color inks when it should not. For the PrinceXML handling of this, see https://www.princexml.com/doc/graphics/#rich-black-and-true-black, where they talk of the RGB color being "encoded in the DeviceGray color space"

When the value use-true-black is used, such an RGB value will be encoded in the DeviceGray color space in the PDF. A CMYK printer should print the gray level using only the black ink. This is the default setting of Prince.

Expected behavior

Removing the Black (K) separation with the Print Production > Output Preview tool should make the text dissappear entirely, thus confirming it is only printing with Black ink, and not any of the other colors

Version numbers

Quire CLI 1.0.0-rc.7 Quire 11ty 1.0.0-rc.9 Node 18.16.0

What browsers are you seeing the problem on?

No response

Relevant Terminal/Shell output

No response

Supporting Information

Paged.js without Black ink:

Screen Shot 2023-05-17 at 4 48 22 PM

PrinceXML without Black ink:

Screen Shot 2023-05-17 at 4 48 04 PM
fchasen commented 1 year ago

A few option for handling this at the moment:

Ideally we'd use Ghostscript.js npm library to include the Ghostscript commands for color processing directly in the Paged.js CLI but I don't think the Ghostscript dual licensing will allow for that, so either we can make it a separate optional plugin or eventually use PDF-lib to parse, converting and replace colors.

geealbers commented 1 year ago

Thanks @fchasen. I'm going to take you off the issue but am reopening it until we can figure out and document a reasonable process for Quire users to convert rick-black to black-only text in their PDFs. My own first attempts through Acrobat were woefully unsuccessful. I'm wondering though if our production department might be able to advise so I will follow up with them as a next step.

Erin-Cecele commented 1 year ago

We are currently working on a fix for your bug! Stay tuned for updates and thank you for your important contribution.