Replacing vector images in a PDF with raster images

Michael Boyer picture Michael Boyer · Mar 7, 2012 · Viewed 17.3k times · Source

Is there any easy (scriptable) way to convert a PDF with vector images into a PDF with raster images? In other words, I want to generate a PDF with the exact same (un-rasterized) text but with each vector image replaced with a rasterized version.

I occasionally read PDFs of technical articles on my Kindle, and have found that reading a PDF directly is frustrating. Thankfully, Amazon's automatic conversion of PDFs to the Kindle format does a good job of reflowing the text portions of most of PDFs I have tried. However, while raster images seem to make it through the conversion process fine, vector images get horribly mangled. It would be great if I could easily convert a PDF so that all of its vector images were rasterized.

I am interested in any possible solutions, but a Linux- or Windows-based one would be preferable.

Answer

vertikalist picture vertikalist · Jul 1, 2013

I had a similar issue, and solved it using ImageMagics convert tool (http://www.imagemagick.org/script/index.php). That comes with linux and runs fine on Windows/Cygwin or OS X

convert -density 300 largeVectorFileFromR.pdf out.pdf

With -density 300 you control resolution (as DPI).

Downside: Text is rasterized as well, I understand that Michael does not want this.