python 提取PDF文字

使用pdfplumber,不能提取扫描的pdf和插入的图片。

python 复制代码
import pdfplumber

file_path = r'D:\UserData\admindesktop\官方文档\1903_Mesh-Models-Overview_FINAL.pdf'
with pdfplumber.open(file_path) as pdf:
    page = pdf.pages[0]
    print(page.extract_text()) # 所以文字
    print([word["text"] for word in page.extract_words()]) # 提取存在的文字
相关推荐
bitbrowser15 分钟前
哪些指纹浏览器支持模拟SSL指纹
网络·python·网络协议·ssl
limenga1021 小时前
TensorFlow Keras:快速搭建神经网络模型
人工智能·python·深度学习·神经网络·机器学习·tensorflow
心软小念2 小时前
用Python requests库玩转接口自动化测试!测试工程师的实战秘籍
java·开发语言·python
sanggou3 小时前
【Python爬虫】手把手教你从零开始写爬虫,小白也能轻松学会!(附完整源码)
开发语言·爬虫·python
geng_zhaoying3 小时前
在VPython中使用向量计算3D物体移动
python·3d·vpython
半tour费4 小时前
TextCNN-NPU移植与性能优化实战
python·深度学习·分类·cnn·华为云
普通网友4 小时前
使用Flask快速搭建轻量级Web应用
jvm·数据库·python
百锦再4 小时前
第17章 模式与匹配
开发语言·后端·python·rust·django·内存·抽象
普通网友5 小时前
Python函数定义与调用:编写可重用代码的基石
jvm·数据库·python
普通网友5 小时前
使用Python进行PDF文件的处理与操作
jvm·数据库·python