技术栈
pdf_to_word.py
188_djh
23 天前
python
·
pdf
·
word
·
python-docx
·
pypdf2
·
python3.9
·
pdf_to_word.py
# 使用python写一个PDF文件转换成word 文件
要使用 Python 将 PDF 文件转换成 Word 文件,可以借助PyPDF2库来读取 PDF 文件内容,再使用python-docx库将内容写入 Word 文件。不过,PyPDF2只能处理文本类型的 PDF,如果 PDF 是扫描版的(即图像类型),则需要使用pytesseract库结合Pillow库进行 OCR(光学字符识别)。