LeoFCardoso / pdf2pdfocr

A free tool to OCR a PDF and add a text "layer" in the original file, making a searchable PDF. Use only open source tools. Please tip!
Apache License 2.0
266 stars 33 forks source link

TypeError: expected str, bytes or os.PathLike object, not NoneType #12

Closed AmirthaKrishnan closed 5 years ago

AmirthaKrishnan commented 5 years ago

]# python3 pdf2pdfocr.py -i /home/amuthuraman/NonOcrpdf/test.pdf [2019-05-30 02:43:00.729260] [LOG] Tesseract can 'textonly_pdf': False [2019-05-30 02:43:00.739282] [LOG] Tesseract version: 3 Traceback (most recent call last): File "pdf2pdfocr.py", line 1214, in pdf2ocr = Pdf2PdfOcr(args) File "pdf2pdfocr.py", line 450, in init self.check_external_tools() File "pdf2pdfocr.py", line 531, in check_external_tools if not self.test_convert(): File "pdf2pdfocr.py", line 1031, in test_convert stderr=subprocess.DEVNULL, shell=self.shell_mode) File "/usr/lib64/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib64/python3.6/subprocess.py", line 1278, in _execute_child executable = os.fsencode(executable) File "/usr/lib64/python3.6/os.py", line 800, in fsencode filename = fspath(filename) # Does type-checking of filename. TypeError: expected str, bytes or os.PathLike object, not NoneType

LeoFCardoso commented 5 years ago

Please check if ImageMagick is installed and "convert" program is available in your path. I will fix the script to show the correct error message. Thanks for reporting.