-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherrors_solution.txt
62 lines (44 loc) · 1.63 KB
/
errors_solution.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- Installation --
Install tesseract
Put all the folder's bin to environment variables
-- Leptonica Location --
C:\Program Files (x86)\Tesseract-OCR\liblept-5.dll
-- pikepdf not found --
installed pikepdf v1.7.0
-- freeze_support() ERROR --
Just need to have if __name__ == '__main__' in the Main.py
-- Password encrypted file --
We can use qpdf to input password for the pdf
-- pikepdf functionality --
AttributeError: 'pikepdf._qpdf.Pdf' object has no attribute 'check'
add following code in _methods.py present in "your location\ocrmyPDF_Windows\ocr_env\Lib\site-packages\pikepdf".
after def encryption(self)
def check(self):
"""
Check if PDF is well-formed. Similar to ``qpdf --check``.
Returns:
list of strings describing errors of warnings in the PDF
"""
class DiscardingParser(StreamParser):
def __init__(self): # pylint: disable=useless-super-delegation
super().__init__() # required for C++
def handle_object(self, obj):
pass
def handle_eof(self):
pass
problems = []
try:
self._decode_all_streams_and_discard()
except PdfError as e:
problems.append(str(e))
discarding_parser = DiscardingParser()
for basic_page in self.pages:
page = Page(basic_page)
try:
page.parse_contents(discarding_parser)
except PdfError as e:
problems.append(str(e))
for warning in self.get_warnings():
problems.append("WARNING: " + warning)
return problems
# till here