5

python-office自动化办公:Word批量转PDF

 2 years ago
source link: https://blog.51cto.com/CoderWanFeng/5252673
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Python官网发布了Python自动化办公的库:python-office,相关信息:​ ​重磅!官网发布第三方库:python-office,为Python自动化办公而生​

不需要自己写代码,直接调用写好的方法就行。

大家好,这里是程序员晚枫,专注于分享:Python自动化办公。

这个系列教程,用来逐一介绍python-office自动化办公的功能。

今天我们介绍这个库的功能之一:

自动化批量Word转PDF,你只需要输入存放Wor的文件的文件夹位置,剩下的,交给python吧

python-office自动化办公:Word批量转PDF_官网

下载python-office

只需要下面这一条命令,就可以自动下载和安装python-office

pip install python-office

也欢迎大家参与python-office这个开源项目的建设:

开源地址:

https://gitee.com/CoderWanFeng/python-office

https://github.com/CoderWanFeng/python-office

import office # 导入python-office

path = '.' # path这里,填写你存放word文件的位置,例如:C:/app/workbook
office.word.docx2pdf(path=path)

注意:这个功能,目前只支持docx格式的文件。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK