Convert rgb pdf file to cmyk

First we need imagemagick. Install it using following command:

$sudo apt-get install imagemagick

Following commands convert the rgb pdf fileĀ  to cmyk

1. Check whether the test.pdf is rgb or cmyk

$ identify -verbose ‘test.pdf’

It displayes the many properties. Check colorspace: rgb /cmyk

If it displayes cmyk, then its ok. Otherwise need to convert into cmyk

2. To convert rbg to cmyk use following command:

$ gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -dProcessColorModel=/DeviceCMYK -sOutputFile=output.pdf input.pdf

It displays the following output:

Replace the input.pdf with your test pdf file

3. Now again check the properties of pdf file by following command:

$ identify -verbose 'test.pdf'

It displays the following output: