【发布时间】:2020-08-28 08:49:44
【问题描述】:
如何使用 python 在 pdf 文件中查找发票表的区域坐标? 我目前正在使用 camelot 或 tabula 从 pdf 文件中提取表格。但是我想知道是否有办法提取每个表的区域坐标,以便我可以相应地进行自定义
【问题讨论】:
标签: python extract invoice tabula python-camelot
如何使用 python 在 pdf 文件中查找发票表的区域坐标? 我目前正在使用 camelot 或 tabula 从 pdf 文件中提取表格。但是我想知道是否有办法提取每个表的区域坐标,以便我可以相应地进行自定义
【问题讨论】:
标签: python extract invoice tabula python-camelot
在 Camelot 中,表格坐标在表格属性_bbox 中指定。
例子:
import camelot
tables=camelot.read_pdf('your_doc.pdf', pages='1-end')
for i,table in enumerate(tables):
print(f'table id: {i}')
print(f'page: {table.page}')
print(f'coordinates: {table._bbox}')
【讨论】: