Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to create pdf with inverted colours of original one?

(Just like inverting whole screen with xcalib -i -a)

Preferably : not loosing hyperlinks. But it's not requirement. It would be nice if images also get inverted.

share|improve this question
Maybe ImageMagick is a starting point -- I've just tried convert orig.pdf -negate negative.pdf but the result is not that good....maybe there're caveats I'm not aware of. –  sr_ Feb 29 '12 at 18:35

1 Answer 1

A while ago, I was able to find a way to invert postscript files (although it failed for some files, I guess the ones which somehow override the change).

Adding {1 exch sub} settransfer as the first command in the file would invert the colors of the document (bitmap pictures included).

For the PDF → postscript conversion, you can use pdftops from libpoppler (AFAIK, the ghostscript pdf2ps generates suboptimal results). Unfortunately, this will not be kept when generating a PDF from the now negated postscript file.

Note that some pdf viewers have the ability to invert colors, such as xpdf (which does not invert bitmaps) and evince (which inverts everything, apparently no matter the format (PDF, postscript, djvu, ...)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.