3

I found these posts on converting a PDF to JPG using ImageMagick. However, I have a 12 page PDF I want to convert into 12 separate high quality jpg files.

Looking for the least tedious way possible.

Thanks.

3 Answers 3

4

I would recommend GhostScript:

gs -sDEVICE=jpeg -r300x300 -dNOPAUSE -dBATCH -sOutputFile="image00.jpg" "input.pdf"

r parameter is resolution

gs -sDEVICE=jpeggray -r300x300 -dNOPAUSE -dBATCH -sOutputFile="image00.jpg" "input.pdf"

This one is for grayscale output.

3
  • Fantastic, thank you. The -rnumber1xnumber2 option is kind of irrelevant for a jpg right? I could just use -r72 for 72dpi or -r150 for 150dpi right? Jun 24, 2014 at 22:56
  • 1
    Complementing the GhostScript answer, if you're a Windows user and have trouble using the gs command line (like me), download also the Ghostscript Studio. With just a few clicks you'll get the PDF divided quite easy!
    – erick2711
    Sep 4, 2015 at 20:55
  • 2
    I found this command only outputs a single jpeg. Using -sOutputFile="image-%03d.jpg" instead works as expected, with a single jpeg per page of PDF.
    – Scorpion
    Nov 13, 2022 at 17:28
0

Another option would be sejda-console (requires Java):

sejda-console pdftojpeg --files input.pdf --resolution 300 --output /outputdirectory

Full documentation:

Usage: sejda-console pdftojpeg options
    --files -f value... : pdf file to operate on: a single pdf file (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
    [--help -h] : prints usage information. Can be used to detail options for a command '-h command' (optional)
    --output -o value : output directory (required)
    --outputPrefix -p value : prefix for the output files name (optional)
    [--overwrite] : overwrite existing output file (optional)
    [--resolution -r value] : resolution in dpi. Default is 72 (optional)
    [--userZoom -z value] : zoom factor for the generated images (EX. 1.5 generates images with a 150% zoom factor). (optional)

If you just want to quickly convert a single file and privacy is not a concern you can always use their web app instead.

0

If you have a Mac this is very easy to do using Automator. You just need three actions:

Ask for finder items Render PDF pages as images Move finder items You can even select the color model, format (12 available), resolution and compression quality. Just to test it out, I converted a PDF file I have here with 207 pages:

Using "600dpi/RGB/best quality possible" it took an hour to convert to JPEG. Using "300dpi/RGB/60% quality" it took about 5 minutes to convert to JPEG. (My laptop have a Core 2 Duo 2.26Ghz)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .