进一步加大网站集约化建设力度,wordpress 爱主题,网址导航名词解释,wordpress菜单 不显示图片1、Pdfplumber介绍
pdfplumber的github地址#xff1a;
https://github.com/jsvine/pdfplumber/【介绍】#xff1a;pdfplumber 是一个用于处理 PDF 文件的 Python 第三方库#xff0c;它提供了一种方便的方式来提取 PDF 文件中的文本、表格和其他信息。【功能】#xff…1、Pdfplumber介绍
pdfplumber的github地址
https://github.com/jsvine/pdfplumber/【介绍】pdfplumber 是一个用于处理 PDF 文件的 Python 第三方库它提供了一种方便的方式来提取 PDF 文件中的文本、表格和其他信息。【功能】pdfplumber 主要用于解析和提取 PDF 文件中的文本、表格、图像等信息。 适用版本支持 Python 3.6 及以上版本。【特点】简单易用、准确性高、多平台支持包括 Windows、Mac 和 Linux、功能强大。【安装】pip install pdfplumber
2、内容提取
【1】读取page对象
代码
import pdfplumberwith pdfplumber.open(./file/test.pdf) as read_pdf:# 读取page对象print(read_pdf.pages)输出结果 【2】打印完整内容
代码
import pdfplumberwith pdfplumber.open(./file/test.pdf) as read_pdf:# 读取page对象pages read_pdf.pagesfor page in range(len(pages)):text read_pdf.pages[page].extract_text()print(f--------------第{page 1}页内容---------------)print(text)打印结果