Note : The installation instruction below are for Ubuntu however they should work perfectly well on any other distro as long as you have ImageMagik and Ghost Script installed.
Installing ImageMagick
ImageMagick is a powerful command line image processing package with a number of features you could install it using the following command :
sudo apt-get install imagemagickAfter installation is over to convert say sample.pdf to sample.png issue the following command
convert sample.pdf sample.png
or
convert sample.pdf sample.jpg
Now if sample.pdf has multiple pages ImageMagick would convert each individual page into a separate file for example : 1st page as sample-0.png , 2nd page as sample-1.png and so on .
However ImageMagick internally uses Ghostscript to convert the file to graphics image so resolution might be bit less and if you want to convert document into higher resolution image you could do so by using Ghostscript directly.
There are number of options available in convert which you could inquire by issuing convert -? command.
Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney
7 comments:
Hi there,
I have 32 pages of pdf file and I want to convert it into png format with 4 images per page. Please show me how to do it. Thanks.
Print those 32 pages as another PDF with 4 pages per page, first. Then use imagemagick.
For the quality, just play around with the -density switch
$ convert -density 300 sample.pdf sample.png
hmmm...
Thanks! The density switch is exactly what I needed!
> I have 32 pages of pdf file and I want to convert it into png format with 4 images per page.
convert sample.pdf _.jpg
montage *.jpg -mode Concatenate -tile 4x1 line.jpg
so useful, thx a lot!
Post a Comment