python - 如何使用python在pdf文件中查找发票表的区域坐标?
问题描述
如何使用python在pdf文件中查找发票表的区域坐标?我目前正在使用 camelot 或 tabula 从 pdf 文件中提取表格。但是我想知道是否有办法提取每个表格的区域坐标,以便我可以相应地自定义
解决方案
在 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}')
推荐阅读
- python - 如何使用 OpenCV 检测 X 射线图像上的文本
- javascript - JavaScript:将数组简化为嵌套对象
- c++ - 循环链接队列不排队值
- python - 如何切片 Pandas 日期时间索引以始终选择第一天
- amazon-web-services - AWS CloudWatch 自定义指标最佳实践
- html - 在 for loop django 模板的每个循环中生成唯一的 id
- sql - PowerBi 图表中每个钻取级别的不同值
- r - 选择一个数字是否包含在一个范围之间
- xamarin.forms - Xamarin Forms - 当一个属性更改时更新多个视图/页面
- javascript - 在反应代码中导入库会引发编译错误