Sunday, August 10, 2008

Extracting images from pdf

During my studies I sometimes had to hold a lecture on a certain topic that was presented in a few published papers. When holding such lectures then you really should show some graphs and figures from those papers (don't worry, this falls under fair use of the copyrighted material ... I believe ;) ). An incredibly convenient tool to extract images from pdf files is the pdfimages tool that comes with poppler. All you have to do is issue the command

pdfimages paper.pdf some-prefix

where some-prefix is a name chosen by you and will be added in front of all the image names the command produces. After this your current directory will have all the images in the paper and theyr names will be some-prefix-000.ppm (or .pbm or .jpg but to get .jpg you have to give it the -j option and it won't work for all the images probably, pdfimages -j paper.pdf some-prefix). Then you can import the images into your Impress presentation (I use Impress to make my presentations and then export them to pdf) or use convert to switch between image formats if you are using a presentation software that doesn't support those formats pdfimages produces.

No comments: