Convert a PDF to greyscale on the command line.

I have a colour PDF file, and I'm going to print it out and then photocopy it in black and white. I'd like to know what it's like in B&W before photocopying it. Is it possible to 'greyscale' a PDF on the command line using free software? 

best answer from https://superuser.com/questions/104656/convert-a-pdf-to-greyscale-on-the-command-line-in-floss

gs 
 -sOutputFile=output.pdf 
 -sDEVICE=pdfwrite 
 -sColorConversionStrategy=Gray 
 -dProcessColorModel=/DeviceGray 
 -dCompatibilityLevel=1.4 
 -dNOPAUSE 
 -dBATCH 
 input.pdf

在win下:
gswin64c 
 -sOutputFile=output.pdf 
 -sDEVICE=pdfwrite 
 -sColorConversionStrategy=Gray 
 -dProcessColorModel=/DeviceGray 
 -dCompatibilityLevel=1.4 
 -dNOPAUSE 
 -dBATCH 
 input.pdf