Remove / Delete all images from a PDF using Ghostscript or ImageMagick

codin picture codin · Dec 19, 2013 · Viewed 7.5k times · Source

I want to delete / remove all the images in a PDF leaving only the text / font in the PDF with whatever command Line tool possible.

I tried using -dGraphicsAlphaBits=1 in a Ghostscript command but the images are present but like a big pixel.

Answer

johnwhitington picture johnwhitington · Dec 20, 2013

You can use the draft option of cpdf:

cpdf -draft in.pdf -o out.pdf

This should work in most situations, but file a bug report if it doesn't do the right thing for you.

Disclosure: I am the author of cpdf.