Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing vector images in a PDF with raster images

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.

like image 587
Michael Boyer Avatar asked Mar 07 '12 19:03

Michael Boyer


People also ask

Does .PDF use raster or vector images?

Is a PDF a raster or vector? Most PDFs are vector files. However, it depends on the program used to create the document because PDFs can also be saved as raster files. For example, any PDF created using Adobe Photoshop will be saved as a raster file.

Can vector graphics be converted to raster graphics?

A. Yes. Software such as Adobe Illustrator may be able to convert raster images to vector images; although, slight variation from the original can sometimes occur in the process. Vector images can be converted to raster images by opening and saving them with Adobe Photoshop or a similar image editing program.

Is it possible to convert vector images to raster using acrobat?

Is there any possibilities to convert those vector images to raster using acrobat?. Ask your questions in Questions & Answers or the Adobe Forums. Well, you could still export the pages to raster image files as mentioned before, and then attempt to run OCR on the new PDF pages once you reconvert them to recapture your text.

Is a PDF A raster or a vector?

So a PDF is never really “raster” or “vector” but rather is a container file type that could contain one or more forms for representing items visually. From the perspective of your eyes, two images that look almost exactly the same can be vector and raster. You can’t always spot the difference quickly.

How do I convert a pdf map to a raster image?

First you crop the map which is there in your PDF using snipping tool and save this cropped image map in any image formats (preferably in .TIFF format) using image processing software. (I am using FastStone Photo Resizer). Then you can import that into GIS software as raster image.

How can I convert an image to a vector map?

Then you can import that into GIS software as raster image. However, you really can not convert any image into vector map unless n until you digitize the same. All the best.. you can also use Universal Document Converter to convert pdf into image (raster) and vice versa. then any GIS software for raster to vector conversion


1 Answers

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.

like image 163
vertikalist Avatar answered Oct 07 '22 10:10

vertikalist