Sometimes, for strange reasons, you can have the need to convert a pdf file into an image or into a collection of images.
I've tried a lot of methods to do this job, I used: inkskape, gimp, libreoffice……. to import a save,
They can do this simple job, but they are not designed for this specific job.
If you have a pdf file, long one page, you can use the above programs and you will win the match, but if you have to do something complex you will loose the game.
For example imagine you have to convert in png format a pdf file containing 50 pages and you want to use inkscape to convert it. You ave to
- Open the file.pdf with inkscape
- Select the page you want to convert
- Select all the elements of the pages
- Export the selection as png file
- Give it a name.
- Go to step 1 for the next page.
This is a long and tedious work, but the shell can help you.
If you are on a UNIX system (but this works also on cygwin) you have to install the imagemagick packet.
The from the shell you have to issue a command like the following one:
$ convert file.pdf pageNo%d.png
this enough for a first attempt. You can also change the output format changing the extensions of the second argument, for example if you issue:
$ convert file.pdf pageNo%d.jpg
$ convert -quality 100 file.pdf pageNo%d.jpg
$ convert -quality 100 -density 144x144 file.pdf pageNo%d.jpg