I use (Lua)LaTeX to create a PDF for printing. The color workflow is not well-managed: The PDF contains CMYK-colored LaTeX elements, PDF figures created in Inkscape, and RGB photos. ImageMagick's identify
tool reveals that all pages are in the sRGB color space (which may or may not be significant). Lacking Adobe software and its Preflight feature, I tried to use GhostScript to convert my PDF file. A print shop is likely to provide a certain ICC profile for the colors that the PDF will need to be compliant with. So, having read up on color management in GhostScript and some related questions here, I came up with the following script using GhostScript 10.01.1 (on Windows 10 64-bit):
gswin64c ^
-o "output.pdf" ^
-sDEVICE=pdfwrite ^
-dAutoRotatePages=/None ^
-dRenderIntent=0 ^
-sOutputICCProfile=ISOcoated_v2_bas.ICC ^
"input.pdf"
The call fails with undefined in .putdeviceprops
and a stack of .putdeviceprops --nostringval-- unknownerror
. Being fairly new to the GhostScript world, online research would not yield reasonable results without having to dive into implementation details of GhostScript. So, troubleshooting revealed that the -sOutputICCProfile
line is the problematic one, although it seemed to be the straighforward option. Using another profile yields the same error.
If I use the (apparently deprecated) option -sColorConversionStrategy=CMYK
instead, GhostScript runs and produces a PDF in CMYK with color separation (according to ImageMagick's identify
), but some and especially green-ish colors in the PDF are far off the intended color. This cannot be a solution anyway since, as said, I have to use whatever ICC profile will be given to me.
So here are the questions: Is it true that GhostScript converts the PDF colors to a perceptual space (i.e., CIE), and then to the output profile? Why is the -sOutputICCProfile
breaking the call? How can I get GhostScript to use a certain ICC profile for the converted PDF?
Also, this is just the beginning of what I'm trying to accomplish. If the print shop would require the file to be PDF-X compliant, would I need to alter how the color space is ensured?