Sunday, November 21, 2010

How to convert PDF documents to JPG/PNG files in Ubuntu

PDFs are so famous that every document that we download now from the internet are in pdf formats. PDF readers are omnipresent that even most of the phones now come with. Whenever I have some document to send through mail I just send it as a pdf document. But there are times when you may want to put a pdf document on a website. The simplest way is to convert the pdf file into jpg/png file which can be easily uploaded to a website. Here's a simple way that converts pdf document to jpeg/png image files in less than 2 seconds.
You need to install imagemagick. On ubuntu, you can do it by typing this in your terminal.
sudo apt-get install imagemagick
Then its just a cake's walk. Execute the following in terminal.
To convert it to jpg image -
convert example.pdf example.jpeg
and if you want to convert it to png -
convert example.pdf example.png
If there are multiple pages in your pdf document then the files will automatically renamed to file-0.jpg file-1.jpg file2-jpg and so on.
Hope that comes in handy next time you want to put a pdf file on your website. 

No comments:

Post a Comment