PDF->JPG memory usage

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
CptWacko

PDF->JPG memory usage

Post by CptWacko »

Hi all,

I have some trouble when I'm trying to convert large pdf to jpgs, IM uses way too much memory, something like 10gb for a 150 pages pdf. Is there any way to use a "normal" (1-2gb top) quantity of memory to do this thing ? I saw that stream.exe can read images line by line but when I try using it on a pdf with the same line that is in the examples, it tells me "missing an image filename".

So I guess my question is, is there anyway to split a pdf (or something like that) before processing so it takes less memory total ?

Thanks !
CptWacko

Re: PDF->JPG memory usage

Post by CptWacko »

BTW, I cleared my source pdf while trying to use stream.exe on it, it says it's a 0 byte file afterwards. I don't know if that was a known issue so I'm posting it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PDF->JPG memory usage

Post by magick »

You can convert a single page at a time:
  • convert 'image.pdf[0]' 0.jpg
    convert 'image.pdf[1]' 1.jpg
You can also force the entire PDF to disk rather than memory by adding -limit area 1 to your command line:
  • convert -limit area 1 large.pdf large.jpg
CptWacko

Re: PDF->JPG memory usage

Post by CptWacko »

Thanks a lot man, your answer actually solved 2 of my problems.
Post Reply