Lubos Rendek

The only solution is determination.

Convert Multiple Page PDF Document to Separate Images

| Comments

If you from some reason need to convert your PDF document into multiple images such as PNG or JPG you can use Imagemagick suite to do this job. First create a directory and place there you PDF document you wish to convert.

1
2
mkdir pdf2image
cd pdf2image

Copy your PDF document into this directory and run a following command.

1
convert -resize 500x mypdfdoc.pdf mydoc.png

The command above will create multiple transparent png images. The number of images depends on number of pages in you original PDF document. The option resize means that all output images will have a width of 500px. Feel free to adjust this size or even omit it if necessary.

In case that you do not wish to have a transparent background images change to above command to:

1
convert -resize 500x mypdfdoc.pdf mydoc.jpg

or convert all your png images and set white background for all new created image using simple bash for loop:

1
for i in $( ls *.png ); do convert -flatten $i bg_$i; done

All images with a prefix bg_ will now have white background.

Comments