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()]) # 提取存在的文字
相关推荐
敏编程38 分钟前
一天一个Python库:tomlkit - 轻松解析和操作TOML配置
python
2401_8796938744 分钟前
使用Python进行图像识别:CNN卷积神经网络实战
jvm·数据库·python
yunyun321231 小时前
机器学习模型部署:将模型转化为Web API
jvm·数据库·python
团子和二花1 小时前
openclaw平替之nanobot源码解析(七):Gateway与多渠道集成
python·gateway·agent·智能体·openclaw·nanobot
未知鱼1 小时前
Python安全开发之简易目录扫描器(含详细注释)
开发语言·python·安全
Be1k02 小时前
推荐一款语雀知识库批量导出工具
python·gui·工具·语雀·批量导出·原创
Sunshine for you2 小时前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---2 小时前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python
Red丶哞3 小时前
内网自建Postfix使用Python发送邮件
开发语言·python
rebekk3 小时前
pytorch custom op的简单介绍
人工智能·pytorch·python