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

推荐订阅源

D
DataBreaches.Net
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Y
Y Combinator Blog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
量子位
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
C
Cybersecurity and Infrastructure Security Agency CISA
L
Lohrmann on Cybersecurity
L
LINUX DO - 最新话题
The Register - Security
The Register - Security
T
Tailwind CSS Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
Stack Overflow Blog
Stack Overflow Blog
Cloudbric
Cloudbric
S
Secure Thoughts
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
L
LangChain Blog
Recorded Future
Recorded Future
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Tor Project blog
人人都是产品经理
人人都是产品经理
F
Full Disclosure
O
OpenAI News
Webroot Blog
Webroot Blog
A
Arctic Wolf
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
H
Heimdal Security Blog
B
Blog RSS Feed
Vercel News
Vercel News

博客园 - 渺晓

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、运行代码