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.
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.
Time has passed, and development of Ghostscript has progressed...
The latest releases have the following new command line parameters. These can be added to the command line:
-dFILTERIMAGE
: produces an output where all raster drawings are removed.
-dFILTERTEXT
: produces an output where all text elements are removed.
-dFILTERVECTOR
: produces an output where all vector drawings are removed.
Any two of these options can be combined.
Example command:
gs -o noimage.pdf -sDEVICE=pdfwrite -dFILTERIMAGE input.pdf
More details (including some illustrative screenshots) can be found in my answer to "How can I remove all images from a PDF?".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With