How to batch convert multi-page PDF into individual jpg files

2

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.

SteveLambert

Posted 2014-06-24T17:13:35.117

Reputation: 218

Answers

3

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.

Cornelius

Posted 2014-06-24T17:13:35.117

Reputation: 2 524

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? – SteveLambert – 2014-06-24T22:56:42.867

1Complementing 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 – 2015-09-04T20:55:55.890

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.

Glutanimate

Posted 2014-06-24T17:13:35.117

Reputation: 314

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)

PaulSmith

Posted 2014-06-24T17:13:35.117

Reputation: 1