【问题标题】:Getting Warning messages in Tabula.py python在 Tabula.py python 中获取警告消息
【发布时间】:2018-08-08 15:58:59
【问题描述】:

我正在研究使用 python 将 pdf 文件转换为 csv 的项目。我正在使用tabula.py。一切正常。我在 csv 文件中获得了清晰的表格,但 tabula.py 显示如下警告消息:

Nov 08, 2017 10:48:48 AM org.apache.pdfbox.pdmodel.font.PDSimpleFont toUnicode
WARNING: No Unicode mapping for .notdef (9) in font Helvetica.

如何抑制或静音此警告?

【问题讨论】:

    标签: python csv pdf tabula


    【解决方案1】:

    调用tabula.read_pdf时,添加java选项:

    tables = tabula.read_pdf(xxxxxx, java_options=[
        "-Dorg.slf4j.simpleLogger.defaultLogLevel=off",
        "-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog"
    ])
    

    输出来自 java,因此从 python 重定向 stdout 将不起作用。

    【讨论】:

      猜你喜欢
      • 2016-06-15
      • 2012-07-30
      • 2011-02-15
      • 1970-01-01
      • 2018-05-19
      • 1970-01-01
      • 2018-02-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多