【问题标题】:How to read Telugu table items from pdf in python 3如何在python 3中从pdf中读取泰卢固语表格项目
【发布时间】:2020-06-08 10:03:36
【问题描述】:

我正在使用以下源代码从 pdf 中获取英文表格数据。但我无法获取其他语言。任何人都可以帮助我如何传递语言参数并获取任何类型的语言

from tabula import read_pdf

url = "/Users/administrator/Desktop/Telugu_land_document1.pdf"

try:
    df = read_pdf(url, pages='all')
    print(df)
except Exception as e:
    print(e)

【问题讨论】:

    标签: python tabula


    【解决方案1】:

    您可以配置坐标信息,使其与语言无关。

    df = tabula.read_pdf_with_template("/path/xxx.pdf", "path/temp.json")
    

    # cat path/temp.json

    [
      {
        "page":1,
        "extraction_method":"a",
        "x1":157.18,
        "x2":1111.41,
        "y1":270.97,
        "y2":283,
        "width":954.23,
        "height":11.189
      },
      {
        "page":1,
        "extraction_method":"a",
        "x1":157.18,
        "x2":1111.41,
        "y1":270.97,
        "y2":283,
        "width":954.23,
        "height":11.189
      }
      ...
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-18
      • 2022-10-04
      • 1970-01-01
      相关资源
      最近更新 更多