pankrat / pdf-ocr-overlay Goto Github PK
View Code? Open in Web Editor NEWSimple way to make scanned PDFs searchable
Simple way to make scanned PDFs searchable
16:48:06 [INFO] OCR complete. Merge pages into 'output.pdf'
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "./ocr.py", line 174, in process_page
ocr_page(image, lang=lang, width=width, height=height)
File "./ocr.py", line 155, in ocr_page
html = os.open(hocr, os.O_RDONLY)
OSError: [Errno 2] No such file or directory: '/tmp/tmp8mXOjp/-000.html'
Traceback (most recent call last):
File "ocr.py", line 236, in
for name, version in system_info():
File "ocr.py", line 55, in system_info
pdfimages = Popen(['pdfimages', '-v'], stderr=PIPE).communicate()[1]
File "C:\Python37\lib\subprocess.py", line 756, in init
restore_signals, start_new_session)
File "C:\Python37\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Using it under Ubuntu 14.04.3 server.
*It fails to recognize an AutoCAD pdf and crashes. Should die gracefully instead, if not able to process the file. Output follows:
[email protected][21:40]:~/Test$~/pdfocroverlay/pdf-ocr-overlay-master/ocr.py M101.pdf M101-searchable-pdfocroverlay.pdf
21:41:26 [INFO] pdfimages : pdfimages version 0.24.5
21:41:26 [INFO] tesseract : tesseract 3.03
21:41:26 [INFO] gs : 9.14
21:41:26 [INFO] identify : GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
21:41:26 [INFO] convert : GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
21:41:33 [INFO] 1 pages, 1219mm*914mm
21:41:33 [INFO] Extract pages from M101.pdf
Syntax Error: Unknown character collection 'PDFAUTOCAD-Indentity0'
Syntax Error: Unknown character collection 'PDFAUTOCAD-Indentity0'
21:41:35 [INFO] Process 1 pages with 1 threads
21:41:35 [INFO] Page 1: Run OCR ...
21:41:35 [DEBUG] Page=3456x2592 Image=160x1093 DPI=3x30
Tesseract Open Source OCR Engine v3.03 with Leptonica
Too few characters. Skipping this page
OSD: Weak margin (0.00) for 14 blob text block, but using orientation anyway: 0
21:41:37 [INFO] OCR complete. Merge pages into 'M101-searchable-pdfocroverlay.pdf'
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ubuntu/pdfocroverlay/pdf-ocr-overlay-master/ocr.py", line 176, in process_page
ocr_page(image, lang=lang, width=width, height=height)
File "/home/ubuntu/pdfocroverlay/pdf-ocr-overlay-master/ocr.py", line 157, in ocr_page
html = os.open(hocr, os.O_RDONLY)
OSError: [Errno 2] No such file or directory: '/tmp/tmpa9uFbe/-000.html'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.