【问题标题】:how to find area coordinates of a invoice table in pdf file using python?如何使用python在pdf文件中查找发票表的区域坐标?
【发布时间】:2020-08-28 08:49:44
【问题描述】:

如何使用 python 在 pdf 文件中查找发票表的区域坐标? 我目前正在使用 camelot 或 tabula 从 pdf 文件中提取表格。但是我想知道是否有办法提取每个表的区域坐标,以便我可以相应地进行自定义

【问题讨论】:

    标签: python extract invoice tabula python-camelot


    【解决方案1】:

    在 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}')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2016-08-25
      相关资源
      最近更新 更多