convert pdf to png causes High CPU utilisation

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

convert pdf to png causes High CPU utilisation

Post by Ganesha »

Code: Select all

convert in.pdf[0] out.png
this command converts most of the pdf to png but sometimes results in 100% CPU utilisation of ghostscript and also resulting in a never ending process :(

PS: am using Imagemagick 6.9.2-4
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert pdf to png causes High CPU utilisation

Post by Bonzo »

Do the bad PDF files always fail and the good ones always pass?

If so it must be a problem with the pdf and you will need to post a link to the bad one.
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: convert pdf to png causes High CPU utilisation

Post by Ganesha »

@Bonzo Since the document is a sensitive one. I can't share it. But I have found out that the gs command running background of the not converted pdf using 100% CPU.

Code: Select all

gs -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pamcmyk32 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72x72 -dUseCIEColor -dFirstPage=1 -dLastPage=1 -sOutputFile=/tmp/magick-2473h7IyR1jxJov3%d -f/tmp/magick-2473ljRlL1Re3EWV -f/tmp/magick-2473eXbEz6zff2nO
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert pdf to png causes High CPU utilisation

Post by Bonzo »

I am afraid I am not an expert or have had this problem myself.

I would say you need to track down the difference between the ones that pass and the ones that fail. Are the pdf files created with different software?
Are the original pdf files that fail a lot larger, try setting a density convert -density 300 in.pdf[0] out.png

You can use identify -verbose in.pdf[0] to see the details of the files.
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: convert pdf to png causes High CPU utilisation

Post by Ganesha »

thanks Bonzo will try your suggestion
seirerman
Posts: 1
Joined: 2016-01-21T07:15:03-07:00
Authentication code: 1151

Re: convert pdf to png causes High CPU utilisation

Post by seirerman »

Hello!

I have the same problem, and I can provide a file that causes this behaviour:
https://www.tirol.gv.at/fileadmin/theme ... _druck.pdf

I can also open the file in Adobe Reader without problems.
Post Reply