How to convert a color pdf to black-white?
25
votes
7
answers
52385
views
I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without transforming the pages elements in pictures.
I tried the following command:
convert -density 150 -threshold 50% input.pdf output.pdf
found in another question, [a link](https://unix.stackexchange.com/questions/84709/how-can-i-convert-a-pdf-file-from-gray-scale-to-black-white) , but it does what I don't want: the text in the output is transformed in a poor image and is no longer selectable.
I tried with Ghostscript:
gs -sOutputFile=output.pdf \
-q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-sColorConversionStrategy=/Mono \
-sColorConversionStrategyForImages=/Mono \
-sProcessColorModel=/DeviceGray \
$1
but it gives me the following error message:
./script.sh: 19: ./script.sh: output.pdf: not found
Is there any other way to create the file?
Asked by BowPark
(5155 rep)
Oct 7, 2013, 04:46 PM
Last activity: Jul 25, 2022, 01:06 PM
Last activity: Jul 25, 2022, 01:06 PM