惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
Lohrmann on Cybersecurity
V
Visual Studio Blog
Cyberwarzone
Cyberwarzone
D
Docker
The Hacker News
The Hacker News
C
CERT Recently Published Vulnerability Notes
Vercel News
Vercel News
Project Zero
Project Zero
S
Schneier on Security
aimingoo的专栏
aimingoo的专栏
I
Intezer
腾讯CDC
M
MIT News - Artificial intelligence
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Vulnerabilities – Threatpost
G
Google Developers Blog
N
Netflix TechBlog - Medium
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
Arctic Wolf
S
Securelist
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
Recent Announcements
Recent Announcements
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
T
Threatpost
Latest news
Latest news
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
The GitHub Blog
The GitHub Blog
T
Tor Project blog
P
Proofpoint News Feed

博客园 - 渺晓

2025年终总结2026展望 2024年终总结 centos7.9 升级openssh(9.7p1) 2023年终总结 ELK自动清理索引 docker+docker-compose部署rocketmq集群遇到的大坑 docker-compose部署rocketmq集群 centos7安装docker compose k8s部署jar包心得 kubernetes集群搭建2023 kubepi加入集群,生成token Windows11 Centos7 SSH Server配置 RSA公钥登录 免密登录 CentOS7 安装ElasticSearch8.9+Kibana8.9 windows服务器nginx和iis端口冲突问题 Linux(Centos7.6) 逻辑卷扩容 磁盘扩容 LVM扩容 LVM创建 逻辑卷挂载 2022年终总结 Windows搭建Mysql8 java基础 idea maven 私库 Window10启动Consul后页面UI卡住
python pdf转图片
渺晓 · 2022-10-20 · via 博客园 - 渺晓

参考自:https://www.zhihu.com/question/290525731

0. 安装python环境

https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe

1. 验证python环境是否安装成功,执行以下代码显示结果 Python 3.10.8,则表示环境安装成功

2. 安装python-office(注:安装比较久

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-office -U

3. 代码实现,新建pdf.py文件,编辑以下代码,注意按参数说明进行修改对应地址

# 导入这个库:python-office,简写为office
import office

# 一行代码,实现转换
office.pdf.pdf2imgs(
    pdf_path='D://程序员晚枫的文件夹//程序员晚枫.pdf',
    out_dir='./'
)
# 参数说明:
# pdf_path = 你的PDF文件的地址 
# out_dir = 转换后的图片存放地址,可以不填,默认是PDF的地址

4、运行代码