How to turn a PDF grayscale in Ubuntu?

Solution 1:

One of the ways is to use ImageMagick with some scripting.

You have to try its convert program as follows for single document:

convert -grayscale average color-in.pdf grayscale-out.pdf

More details about possible options are presented in its man-page locally by man convert or online.

Note: you may get "not authorized" message which is fixable by following this Q&A.

Solution 2:

A similar question and answer is there in Stack Overflow.


Convert has the great disadvantage of converting to bitmap images, whatever you do... Try this out:

gs -sOutputFile=outfile.pdf -sDEVICE=pdfwrite \
  -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
  -dCompatibilityLevel=1.4 infile.pdf < /dev/null

You have to redirect from /dev/null because by default, gs is interactive. There is a host of options available to tune the output, you can look at the pdfwrite parameters of ghostscript.

In this method, the output pdf does not blow up in size, and also, its quality does not degrade.