有没有办法使用python将.pdf转换为.csv?

时间:2020-05-24 04:28:54

标签: python tabula

我目前正在使用tabula-py进行实验,但是我在提取pdf数据时尝试的所有文档样本均导致以下错误:返回非零退出状态1。

所以我很好奇是否还有其他方法可以使用python将pdf表中的数据转换为csv文件。

1 个答案:

答案 0 :(得分:0)

可以在StackOverflow和其他资源上找到关于tabula-py的答案。尝试使用Camelot:

pip install camelot-py[cv]


import camelot
tables = camelot.read_pdf('X.pdf')
tables.export('X.csv', f='csv', compress=True) # you can also save it different file formats

请参见此link