Python 操作 pdf(pdfplumber 读取 PDF 写入 Exce)

1. Python 操作 pdf(pdfplumber 读取 PDF 写入 Exce)
1.1 安装 pdfplumber 模块库:
复制代码
pdfplumber.PDF 类
pdfplumber.PDF 类表示单个 PDF ,并具有两个主要属性:

pdfplumber.Page 类
pdfplumber.Page 类常用属性

常用方法

1.2 常用操作
PDF 是 Portable Document Format 的缩写,这类文件通常使用.pdf
作为其扩展名。在日常开发工作中,最容易遇到的就是从 PDF 中读取文本内容以及用已有的内容生成 PDF 文档这两个任务。
复制代码
1.2.1 Python 读取 pdf 文件案例
pdf 文件如下

1.2.2 Python 读取 pdf 文件代码
复制代码
复制代码
1.2.3 Python 读取 pdf 文件存入 Excel 代码
复制代码
执行结果:

版权声明: 本文为 InfoQ 作者【度假的鱼🐟】的原创文章。
原文链接:【http://xie.infoq.cn/article/f1fdd28e80871bf2091f9bf7b】。未经作者许可,禁止转载。
评论