PDF OCR识别工具:OCRmyPDF解决图片类的pdf里的文本识别

OCRmyPDF github

安装方法

  • ubuntu apt install ocrmypdf
  • conda conda install ocrmypdf

安装简体中文包

apt-get install tesseract-ocr-chi-sim

安装英语包

apt-get install tesseract-data-eng

显示所有的语言列表

apt-cache search tesseract-ocr
从展示的列表里选择你需要安装的语言的包,参照上面的命令安装即可。

OCR识别pdf

ocrmypdf --force-ocr old.pdf new.pdf

输出的new.pdf,即可复制文本。

配合img2pdf,把图片转为OCR识别的pdf

安装img2pdf
apt-get install img2pdf

img2pdf --pagesize A4 page*.png | ocrmypdf - myfile.pdf

把本目录下page开头的png图片合并到一个ocr的pdf。


把OCR识别转为txt文本 ocr2text github

sudo apt-get install tesseract-ocr
git clone https://github.com/writecrow/ocr2text.git
cd ocr2text
pip install --user --requirement requirements.txt 

python3 ocr2txt.py

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容