我正在尝试使用 "slate3k" 读取 pdf 文件的文本数据。对我来说似乎很好。但我收到解析错误
我一直在使用 "python3.7" 。
import slate3k
with open("/home/am-it/Desktop/PythonLearning/pdf_practice/invoice-1.pdf","rb")as file:
doc = slate3k.PDF(file)
print(doc)
上述代码的输出应该是 pdf 中的文本。但实际输出是
"Traceback (most recent call last):
File "/home/am-it/Desktop/PythonLearning/pdf_practice/invoslate.py", line 4, in <module>
doc = slate3k.PDF(file)
File "/home/administrator/.local/lib/python3.7/site-packages/slate3k/classes.py", line 59, in __init__
self.doc = PDFDocument()
TypeError: __init__() missing 1 required positional argument: 'parser'"
我已经通过了正确的文件对象,但仍然出现错误。所以请赐教