项目作者: paulocressoni

项目描述 :
Apply OCR on scanned PDF files to extract text from the PDF images.
高级语言: Shell
项目地址: git://github.com/paulocressoni/scanned_pdf_ocr.git
创建时间: 2020-01-11T20:13:13Z
项目社区:https://github.com/paulocressoni/scanned_pdf_ocr

开源协议:MIT License

下载


Apply OCR to Scanned image PDF files

Apply OCR on scanned PDF files to extract text from the PDF images.
This version expects the texts to be written on brazilian portuguese (pt-br).

Setup

To setup the environment on Ubuntu run the code on Ubuntu terminal:

  1. chmod a+x setup.sh # run this line only the first time
  2. ./setup.sh

The code above will install Tesseract, brazilian portuguese language to the Tesseract OCR, imageMagick, and setup the policy.xml file from imageMagick to convert PDF files.

Execute OCR

Copy the script pdf_ocr.sh to the folder containing the scanned PDF files and execute it:

  1. chmod a+x pdf_ocr.sh # run this line only the first time
  2. ./pdf_ocr.sh

Output

The script outputs the following:

  • a txt file containing the text extracted from the PDF;
  • a searchable PDF file containing the text extracted from the PDF;
  • a hocr file containing the text extracted from the PDF.