motorbaby
motorbaby

Reputation: 634

JavaScript to convert vector graphics to raster, but not text, for Acrobat

Looking for a way to convert vector graphics – but not text objects – to rasters in PDFs using the javascript tool in Adobe Acrobat.

In one use case, a page has over 70k vector objects, which renders too slowly on screen.

The answers to this question do not suffice: Replacing vector images in a PDF with raster images. The html rendering tool created an SVG and preserved the vectors. It did not rasterize it. Imagemagick does not preserve text.

Thanks!

Upvotes: 2

Views: 1060

Answers (1)

Max Wyss
Max Wyss

Reputation: 3615

(Acrobat) JavaScript has no access to the imaging layer. Therefore, there is no such option.

To solve your issue, you have a few possibilities:

• Open the vector PDF in a (raster) image editor which does properly interpret the PDF (such as Adobe Photoshop), and save the resulting image as PDF again.

• Get a vector graphics optimizer, which replaces excessive segments with longer curves (no product name comes to my mind, but I stumbled over references in the past). This may be very useful if your vector drawings were created with CAD systems with lousy PDF export (essentially plotting to PDF).

Upvotes: 0

Related Questions