Having seen Viliam's insisting on wanting "Black and White", not "Grayscale" I'm still offering this solution to convert PDF files to grayscale. Because I think that would perfectly fullfil the requirement to "save color toner" and make use of black toner only.
Use Ghostscript (the most recently released version is 9.05) with this command:
gs \
-o black+white.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/prepress \
-sColorConversionStrategy=Gray \
-sColorConversionStrategyForImages=Gray \
-sProcessColorModel=DeviceGray \
-dCompatibilityLevel=1.4 \
/path/to/input.pdf
On Windows, use gswin32c.exe
or gswin64c.exe
instead of gs
. Ghostscript meets Viliam's request for:
- freely available
- Open Source
- callable from a program
and it does the job.
Update
If color conversion does not work as desired and if you see a message like "Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged" then...
- your Ghostscript probably is a newer release from the 9.x version series, and
- your source PDF likely uses an embedded ICC color profile
In this case add -dOverrideICC
to the command line and see if it changes the result as desired.