If you use imagemagick? and say
convert -compress none *.jpg Picts.tiff
Tell me if it works right for you
The commandline alesdario used does the following:
- Tell Ghostscript to use output dimension of 800px by 600px (pixels).
- Tell Ghostscript to use a resolution of 300dpi (dots per inch).
- Tell Ghostscript to use an output dimension of 72 device points.
All three cannot work at the same time, because if two go together they will contradict the third.
At 300dpi a canvas of 800x600 will result in a physical dimension of 2.33in x 2in (inches) -- much less than your original PDF page size (likely) was.
To 'simply get N jpeg images from an N-Pages PDF (from command line)' use this command:
gs \
-sDEVICE=jpeg \
-o output/%d.jpg \
mypdf.pdf
This is the most simple call, will not crop anything and will use Ghostscript's default settings for:
- image resolution: this is 72 dpi for JPEG output
- dimension of the output images: this follows respective PDF page size (however, Ghostscript assumes PDF to use 720dpi).
In order to get N JPEG images from a N-page PDF at a pre-defined resolution and a pre-defined image dimension, you need to do some computing yourself and set the -r
and -g
values accordingly. For example, you may want 200 dpi for your JPEG (from PDF page sizes that were ISO A4 [595x842 pt]): that means you need to add -r200 -g1652x2338
to the commandline if you want to avoid cropping.... This will make Ghostscript resample all pages and the objects contained there to the new resolution.
Best Answer
What you are looking for is an image conversion software that supports batch conversion, aka batch processing.
Some conversion software has batch conversion built in. Alternatively, you can write a script to control the batch conversion (that is possible for all command line software, but some GUI programs support scripting, too).
There are many programs available, what you should use depends on your requirements (GUI/command line, license, price, etc.). One popular option for a simple, free software, general purpose, cross platform command line image converter is ImageMagick.