首页 > 解决方案 > Python - 使用 camelot 以相反的顺序读取 PDF 到 excel

问题描述

我正在使用库 camelot 来阅读 PDF 并使用 Python 导出为 excel。我尝试了两组 PDF 表格。对于一组表格,它可以完美运行。对于另一组 PDF 表单,数字以相反的顺序出现。有谁知道是什么原因导致它以及如何修复它,以便数字处于正常顺序。

以下是 PDF 中的内容和 Camelot 中的内容

这是 PDF 的链接: https ://drive.google.com/file/d/1AOo6a8eBt3-v_UU_OT2p99p3TeW-kk8t/view?usp=sharing 。

这是代码的主要部分:

tables=camelot.read_pdf(SchE_pdf,pages="all")
SchExlsx = ExcelWriter('5471 SchE.xlsx')
for i in list:
    tables[i]
    tables[i].parsing_report
    tables[i].to_excel(SchExlsx,sheet_name=str(i))

标签: pythonpdfocrpython-camelot

解决方案


推荐阅读