TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a simple way of a creating PDF with inverted colours?

A partial solution would be just changing font to white and making the background black.

Is there simple "full" solution of inverting whole PDF pages? (including colors in lstlistings, images, etc)

share|improve this question
It will likely be most efficient to do this with ghostscript. – qubyte Feb 26 '12 at 14:53
For local viewing I use xpdf -rv or invert entire screen with xcalib -i -a. – Grzegorz Wierzowiecki Feb 26 '12 at 20:08
I'd like to invert whole pdf-s. Ghostscript sounds interesting, but I'm afraid of loosing hyperref links. – Grzegorz Wierzowiecki Feb 26 '12 at 20:09
Possible duplicate of: tex.stackexchange.com/questions/40495/… – Ioannis Filippidis Mar 2 '14 at 11:42

You can set a pagecolor with the background package and the page color using the color command. You will need to pass the values onto setlistings as well. Color inversion of images is perhaps not possible although you can manipulate them as well. What do you exactly want the images to look like?

enter image description here

       backgroundcolor=\color{black}, #1
share|improve this answer
I just would like to invert colors of whole pages. This can be done by generating pdf first and than including it and reverting colors. I mentioned about images, just because I don't want to change settings of each used object, but to have a kind of global switch. – Grzegorz Wierzowiecki Feb 26 '12 at 19:59
@GrzegorzWierzowiecki You will then have to look at external tools, or add a switch as an option when you generate the pdf i.e., the pagecolor and color can be set to be activated via an if statement. Best tool externally is Acrobat Professional. – Yiannis Lazarides Feb 26 '12 at 20:07
It's not available for Linux and it's 270$ for commercial use, for Teachers is 120$. I will not pay 120$, just for inverting colors in my pdf ;). – Grzegorz Wierzowiecki Feb 26 '12 at 20:14
@GrzegorzWierzowiecki I would invest 2 minutes and get a trial version ; besides in Poland anything is possible;) – Yiannis Lazarides Feb 26 '12 at 20:22

A better solution (perhaps the best solution) is to use crop package with invert option.

share|improve this answer
Not really: "This option doesn’t invert pictures, nor does it really swap text and paper color." – Martin Schröder Feb 27 '12 at 7:36

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.