Converting PDF to CMYK (with identify recognizing CMYK)

后端 未结 5 1906
眼角桃花
眼角桃花 2020-12-02 06:19

I am having much trouble to get ImageMagick\'s identify to, well, identify a PDF as CMYK.

Essentially, let\'s say I\'m building this file, test.t

5条回答
  •  抹茶落季
    2020-12-02 06:26

    sdaau, the command you used for trying to convert your PDF to CMYK was not correct. Try this one instead:

     gs \
       -o test-cmyk.pdf \
       -sDEVICE=pdfwrite \
       -sProcessColorModel=DeviceCMYK \
       -sColorConversionStrategy=CMYK \
       -sColorConversionStrategyForImages=CMYK \
        test.pdf 
    

    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...

    1. your Ghostscript probably is a newer release from the 9.x version series, and
    2. 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.


    Update 2

    To avoid JPEG artifacts appearing in the images (where there were none before), add:

    -dEncodeColorImages=false
    

    into the command line.

    (This is true for almost all GS PDF->PDF processing, not just for this case. Because GS by default creates a completely new file with newly constructed objects and a new file structure when asked to produce PDF output -- it doesn't simply re-use the previous objects, as a more "dumb" PDF processor like pdftk does {pdftk has other advantages though, don't misunderstand my statement!}. GS applies JPEG compression by default -- look at the current Ps2pdf documentation and search for "ColorImageFilter" to learn about more details...)

提交回复
热议问题