我正在使用Python pdftables从pdf中获取表数据,并按照git中的说明进行操作。
https://github.com/drj11/pdftables
但当我运行代码时
filepath = 'tests.pdf'
fileobj = open(filepath,'rb')
from pdftables.pdf_document import PDFDocument
doc = PDFDocument.from_fileobj(fileobj)我得到这样的错误
File "<stdin>", line 1, in <module>
File "pdftables/pdf_document.py", line 53, in from_fileobj
raise NotImplementedError有人能帮我解决这个问题吗?
发布于 2017-08-14 17:55:29
如果您查看实现from_fileobj函数的file,您可以看到以下注释:
# TODO(pwaller): For now, put fh into a temporary file and call
# .from_path. Future: when we have a working stream input function for
# poppler, use that.如果我理解正确的话,您应该使用from_path函数,因为from_fileobj还没有实现。使用当前代码很容易做到这一点:
filepath = 'tests.pdf'
from pdftables.pdf_document import PDFDocument
doc = PDFDocument.from_path(filepath)https://stackoverflow.com/questions/45671865
复制相似问题