Enjoy the good life everyday!
关闭
欢迎来PyGo个人空间 ^_^
Python实现PDF转WORD的方式 | PyGo²

Python实现PDF转WORD的方式

Python Python实战

背景

网上的PDF转WORD都是收费的,写了好几年的Python了,打算想搞一个开源工具网站,其中的一个常用功能之一就是PDF转WORD,所以想探索一下所有的转换方式,持续更新中。。。。。。


环境

id name Version
1 Python 3.7

结果比较

详解

记录一下所有的包,有需要的可以进行参考。

pdf2docx

官网

https://www.cnpython.com/pypi/pdf2docx#

代码

1
2
3
4
5
6
7
8
9
10
11
import os
from pdf2docx import Converter

data_folder = os.path.join(os.getcwd(), 'pdf')
pdf_file = os.path.join(data_folder, '阿里云数据库.pdf')
print(pdf_file)
word_file = '%s-pdf2docx.docx' % os.path.splitext(pdf_file)[0]
print(word_file)
c = Converter(pdf_file)
c.convert(word_file)
c.close()

优点

缺点

LibreOffice

官网

https://www.libreoffice.org/

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
```

> 优点

> 缺点


#### PyPDF2

> 官网

https://pypdf2.readthedocs.io/en/latest/

> 代码
1
2
3
4
5
6
7
8
9
10
11
12
13

> 优点

> 缺点


#### PDFMiner

> 官网

https://www.unixuser.org/~euske/python/pdfminer/programming.html

> 代码

`

优点

缺点

结束语

坚持每天学习。。。。。。
  • 本文作者:mingliang.gao【一个爱老婆Python程序猿。。。。。。】
  • 本文链接: http://pygo2.top/articles/11221/
  • 版权声明: 本博客所有文章欢迎转载,转载请注明出处!
觉得有帮助 请偶坐个公交车
0%