Search code examples
pdfimagemagickghostscriptimagemagick-convert

convert pdf to jpg genrated pdf not jpg


I have tried convert pdf file to jpg using imagemagick.
There is enough examples, but none of them work.
Example pdf i used is: http://www.pdf995.com/samples/pdf.pdf
command: convert -colorspace cmyk /root/pdf.pdf r.png

I have tried tons of different variations but in result generated file is pdf (only extension is png or jpg) Tried uninstall and install imagemagick, no result;

Version: ImageMagick 7.0.8-22 Q16 x86_64 2018-12-31 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in)

GPL Ghostscript 9.26 (2018-11-20)

Ubuntu 16.04

Solution

  • I have tried answer from here and worked:
    https://www.imagemagick.org/discourse-server/viewtopic.php?t=17117

    wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
    tar xvfz ImageMagick.tar.gz
    cd ImageMagick-*
    ./configure
    make
    make install