PDF conversion using ImageMagick takes forever on some files

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
izavorin
Posts: 9
Joined: 2011-03-22T12:01:31-07:00
Authentication code: 8675308

PDF conversion using ImageMagick takes forever on some files

Post by izavorin »

I have a bunch of PDFs that I am trying to convert to various image formats, including PDF, using ImageMagick's convert that in turn is using GhostView to do the conversion (By the way, the reason I need PDF to PDF conversion is because the original docs are PDF with text behind and I need to produce image-only PDFs). A typical command I am using is this:

Code: Select all

convert -density 300x300  -verbose input.pdf output.pdf
I noticed that often conversion takes a long time and on some documents it never finishes and I have to kill the process. It seems to have something to do with my use of "-density 300x300" option to control the DPI setting of the output. If I don't use it, it seems not to freeze, but in this case the resulting DPI is too low and the output is unreadable, even if the original PDF was of good resolution.

- Is it possible to predict in what situations such conversion will freeze?
- Is it possible to increase output DPI without running into this issue? What parameters should I use?

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF conversion using ImageMagick takes forever on some f

Post by fmw42 »

PDFs don't really have any density. You only set it when you want to convert to some other image format, as best I understand. So you are just converting a PDF from vector to pixel and back to vector. Not a good idea. see http://www.imagemagick.org/Usage/formats/#vector
Post Reply