Convert PDF/Image to TXT using EasyOcr - the best OCR engine available!

Overview

TwitterFacebookInstagramYouTubeWhatsAppWWWPinterestE-Mail


PDFImage2TXT - DOWNLOAD INSTALLER HERE

What can you do with it?

  • Convert scanned PDFs to TXT.
  • Convert scanned Documents to TXT.
  • No coding required!!
  • Installer for Windows
  • Source code included!
  • MIT license

How to install/run?

Tutorial and things you have to know:

,.-''-.,_,.' Step 1 '.,_,.-''-., Screenshot
Defining the problem:
As a German teacher in Brazil, quite often I have
to read texts about philosophy, politics, medicine etc. with my
students. Nowadays, the PDF format is the most common file format to
share text because of its simplicity.

As a German teacher, I distinguish between 3 types of PDFs:

1) The “text-is-text-format”:
The text we see is a real text (for the computer). We can copy and
paste it and search through it using CTRL + F. If all PDFs were like
this, my tool wouldn’t be necessary.

2) The “text-is-picture-with-a-text-overlay-format”: The text we are reading is actually a picture,
but there is a text layer on top of it. Sometimes that works so great that we can’t even notice a difference to the “text-is-text-format”,
but many times we end up getting results like you can see on the right
picture when we use CTRL + C !

3) The “text-is-picture-format”: For
us humans, it is a text but for the computer it is a picture, there
are no additional text layers. We can neither copy the text nor can we
use CTRL + F to search through it.
,.-''-.,_,.' Step 2 '.,_,.-''-., Screenshot
Why PDFImage2TXT?
There are some tools around to solve this problem, but I haven’t found
any which use EasyOCR. EasyOCR is made by some Indian company and
produces the greatest results ever! It is incredible how good it is!
It is far better than everything that I have seen so far, even better
than Googles Tesseract! The only problem is that it is really slow,
but I rather wait longer for great results than having shxxxy results right away.
The only thing I needed to make EasyOcr work the way I
wanted to, was a way to convert the PDF file to images. After searching for about 5 minutes on GitHub, I found a nice tool to convert each page of a PDF
to a jpg file of good quality (300 DPI). Since pdf2jpg
uses Java, please ensure that
Java is installed on your system! If it is not installed, PDFImage2TXT
won’t work on your PC!
,.-''-.,_,.' Step 3 '.,_,.-''-., Screenshot
How to use it?
PDFImage2TXT is very simple to use:
1) Install it
2) Start it
3) Select the PDF or image you want to convert
4) If you convert a PDF file, you can decide what pages you want to convert to text:

if you write 11,12,13,14,15 after having selected the PDF, the app will only convert the pages 11,12,13,14,15!
If you write "ALL", the app will convert the whole PDF document to text!

5) If you convert a picture to text, there is nothing else to configure.
,.-''-.,_,.' Step 4 '.,_,.-''-., Screenshot
Behind the scenes:
You don't have to choose a name for the output folder or file! During the
process, a folder with the same name as your PDF + the ending "_dir"
will be created, and special characters in the name of the folder will be
replaced by underlines.

(Example: Jürgen Habermas - Strukturwandel der Öffentlichkeit -Suhrkamp (2001).pdf becomes J_rgen_Habermas_Strukturwandel_der_ffentlichkeit_Suhrkamp_2001_pdf_dir)

Please make sure that there isn’t already a folder with that name!
Inside the folder, there will be 2 files for each page: one JPG and one TXT
,.-''-.,_,.' Step 5 '.,_,.-''-., Screenshot
Once the entire process is done, PDFImage2TXT will create a single TXT file by joining all TXT files
The final TXT file will be in the same folder and will contain the prefix "complete"!
Everything that you want is in that file! You only need that file!
If you want, you can delete everything else!
,.-''-.,_,.' Step 6 '.,_,.-''-., Screenshot
As you can see, thanks to EasyOcr the results are almost perfect!
The script I wrote, takes care of the hyphens at the end of each line. It
makes sure that all separated words are not separated in the converted
document!
PDFImage2TXT took about 1h15m for a PDF with around
1,000,000 characters. I used an Intel i5-9600KF @ 3.7 GHz with 6
Cores. It should be a lot faster with CUDA enabled (for everybody with
an NVIDIA GPU), but I couldn't get it to run on my PC. I am able to
use Cupy, OpenCV and Spacy with CUDA, but not Easy OCR. If you have
any solution, please tell me/us! It would be nice to implement that
feature!

License

PDFImage2TXT - Copyright (C) 2021 Johannes Fischer www.queroestudaralemao.com.br

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Donations

If this project has helped you somehow, consider donating a small amount. After being absent from computer programming for more than 20 years, I started again this year. At the beginning of 2021, I suffered from a bone infection and had to spend more than 3 months in hospital (only laying in bed!). To kill time, I stared learning Python, which rapidly became something bigger for me than just a "time killer". pavypal

You might also like...
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.

Attention-based OCR Visual attention-based OCR model for image recognition with additional tools for creating TFRecords datasets and exporting the tra

Tesseract Open Source OCR Engine (main repository)

Tesseract OCR About This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM

OCR engine for all the languages

Description kraken is a turn-key OCR system optimized for historical and non-Latin script material. kraken's main features are: Fully trainable layout

A Screen Translator/OCR Translator made by using Python and Tesseract, the user interface are made using Tkinter. All code written in python.

About An OCR translator tool. Made by me by utilizing Tesseract, compiled to .exe using pyinstaller. I made this program to learn more about python. I

Solution for Problem 1 by team codesquad for AIDL 2020. Uses ML Kit for OCR and OpenCV for image processing
Solution for Problem 1 by team codesquad for AIDL 2020. Uses ML Kit for OCR and OpenCV for image processing

CodeSquad PS1 Solution for Problem Statement 1 for AIDL 2020 conducted by @unifynd technologies. Problem Given images of bills/invoices, the task was

Use Youdao OCR API to covert your clipboard image to text.
Use Youdao OCR API to covert your clipboard image to text.

Alfred Clipboard OCR 注:本仓库基于 oott123/alfred-clipboard-ocr 的逻辑用 Python 重写,换用了有道 AI 的 API,准确率更高,有效防止百度导致隐私泄露等问题,并且有道 AI 初始提供的 50 元体验金对于其资费而言个人用户基本可以永久使用

Python tool that takes the OCR.space JSON output as input and draws a text overlay on top of the image.

OCR.space OCR Result Checker = Draw OCR overlay on top of image Python tool that takes the OCR.space JSON output as input, and draws an overlay on to

python ocr using tesseract/ with EAST opencv detector

pytextractor python ocr using tesseract/ with EAST opencv text detector Uses the EAST opencv detector defined here with pytesseract to extract text(de

🖺 OCR using tensorflow with attention

tensorflow-ocr 🖺 OCR using tensorflow with attention, batteries included Installation git clone --recursive http://github.com/pannous/tensorflow-ocr

Owner
Hans Alemão
A German teacher living in Brazil
Hans Alemão
Comparison-of-OCR (KerasOCR, PyTesseract,EasyOCR)

Optical Character Recognition OCR (Optical Character Recognition) is a technology that enables the conversion of document types such as scanned paper

null 21 Dec 25, 2022
It is a image ocr tool using the Tesseract-OCR engine with the pytesseract package and has a GUI.

OCR-Tool It is a image ocr tool made in Python using the Tesseract-OCR engine with the pytesseract package and has a GUI. This is my second ever pytho

Khant Htet Aung 4 Jul 11, 2022
Steve Tu 71 Dec 30, 2022
A tool combining EasyOCR and LaMa to automatically detect text and replace it with an inpainted background.

EasyLaMa (WIP) This is a tool combining EasyOCR and LaMa to automatically detect text and replace it with an inpainted background. Installation For GP

null 3 Sep 17, 2022
Indonesian ID Card OCR using tesseract OCR

KTP OCR Indonesian ID Card OCR using tesseract OCR KTP OCR is python-flask with tesseract web application to convert Indonesian ID Card to text / JSON

Revan Muhammad Dafa 5 Dec 6, 2021
Detect text blocks and OCR poorly scanned PDFs in bulk. Python module available via pip.

doc2text doc2text extracts higher quality text by fixing common scan errors Developing text corpora can be a massive pain in the butt. Much of the tex

Joe Sutherland 1.3k Jan 4, 2023
Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)

English | 简体中文 Introduction PaddleOCR aims to create multilingual, awesome, leading, and practical OCR tools that help users train better models and a

null 27.5k Jan 8, 2023
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched or copy-pasted. ocrmypdf # it's a scriptable c

jbarlow83 7.9k Jan 3, 2023
Programa que viabiliza a OCR (Optical Character Reading - leitura óptica de caracteres) de um PDF.

Este programa tem o intuito de ser um modificador de arquivos PDF. Os arquivos PDFs podem ser 3: PDFs verdadeiros - em que podem ser selecionados o ti

Daniel Soares Saldanha 2 Oct 11, 2021