I have PDF file containing corrupted OCR. It is a bunch of handwritten pages with a lot of symbols and abbreviations, and I got this file with an automatically generated OCR. How can I remove the text layer in order to get a lighter file (and to get rid of the unnecessary OCR)?

  • 2
    It really depends on how the OCR was integrated in the PDF file. Manually: Install mupdf, use mutool clean -d -i -f input.pdf output.pdf to decompress page streams, load into text editor, figure out the structure (read PDF specification), remove pages (or write script to remove them), then mutool -z to compress again. Needs some practice . The file won't get much lighter, the images take the most space, so it's probably too difficult/too much effort to be worth doing it. – dirkt Jun 12 '17 at 7:59
  • @dirkt, Thanks for the comment. Indeed, the file didn't get much lighter, it shrunk from 8MB to 7.7MB. I also tried to take out every image from the original file and then merge the images again to remove the metadata and text layer; and the size reduction was the same. But at least my ereader stopped showing that annoying spaghettish OCRed text. – Seninha Jun 13 '17 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.