2

This question has been asked several times on StackExchange but I could not find a solution that really works. Is there a (desirably) pure ghostscript way to invert the colours of a PDF? The command

gs \
 -sOutputFile=output.pdf \
 -sDEVICE=pdfwrite \
 -sColorConversionStrategy=Gray \
 -dProcessColorModel=/DeviceGray \
 -dCompatibilityLevel=1.4 \
 -dNOPAUSE \
 -dBATCH \
 input.pdf

turns input.pdf into a grayscale output.pdf. Is there a similar command that inverts the colours?

220284
  • 209
  • I do not think that this belongs to the TeX subsite, as this is not directly related. There are some questions on the other sites which already provide solutions for it, like using -c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub} setcolortransfer" (see here for example). – epR8GaYuh Aug 30 '20 at 19:40
  • Yeah, but that doesn't work – 220284 Aug 30 '20 at 19:41
  • I just verified that it works with an up-to-date GPL Ghostscript 9.52 on Windows (with a PDF file having only text) - "It doesn't work" is not a useful problem description. Nevertheless I think that this question does not belong to this subsite and should rather be asked on Stackoverflow or something like Super User. – epR8GaYuh Aug 30 '20 at 19:48
  • Ok, let me be more specific. It doesn't work in the sense that nothing happens to the PDF. It looks exactly the same. I'm running Ghostscript 9.23 on macOS. I suspect that this is the issue mentioned in the original post, i.e., the solution only works on certain PDF viewers. I disagree that this is the wrong place to ask. Many users here are very knowledgeable about Ghostscript. – 220284 Aug 30 '20 at 20:23
  • 1
    I’m voting to close this question because it does not fall within the scope of TeX, LaTeX or related typesetting systems. – Marijn Sep 26 '20 at 17:11

0 Answers0