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:
-o output/%d.jpg \
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
-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.