Converting searchable PDF to a non-searchable PDF

后端 未结 3 1586
余生分开走
余生分开走 2020-12-15 01:49

I have a PDF which is searchable and I need to convert it into a non-searchable one.

I tried using Ghostscript and change it to JPEG and then back to PDF which does

3条回答
  •  佛祖请我去吃肉
    2020-12-15 02:18

    a possible way to produce non-searchable vector pdf from a searchable vector pdf is

    1. burst pdf in its single pages

      pdftk file.pdf burst

    2. convert any single page in svg with

      pdftocairo

      • http://poppler.freedesktop.org/

    contained into poppler utils

    for f in *.pdf; do pdftocairo -svg $f; done
    

    3 . delete ALL pdf in folder

    4 . then, with batikrasterizer

    • http://xmlgraphics.apache.org/batik/tools/rasterizer.html

    re-convert ALL svg to pdf (this time the resulting pdfs will be kept vectorial, but without to be searchable)

    java -jar ./batik-rasterizer.jar -m application/pdf *.svg
    

    final step: join all resulting single page pd in one multipage pdf file

    pdftk *.pdf cat output out.pdf
    

提交回复
热议问题