Tuesday, May 20, 2008
Converting PDF to PNG/JPG using ImageMagick in Linux
Being an undergrad student a lot of the lecture notes and study related material i have is in PDF format now a lot of times i have felt the need of carrying this material around, however carrying laptop around all the time is just not feasible.I have a Video Ipod that could store images and one could view them on the go however it cannot display pdf files so my search began for a tool that could actually convert PDF files into PNG that could be later loaded on to the ipod and viewed at one's convenience .
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 :
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
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
Labels: Converting PDF to PNG, ImageMagick, Tips
Comments:
<< Home
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.
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.
Subscribe to Post Comments [Atom]
<< Home
Subscribe to Posts [Atom]









Post a Comment