我使用python3.6和django1.11。 我用MailMerge创建了一个Word文档,没问题。 现在我需要将此文档保存为pdf文档。在
import win32com.client as win32
from os import path
word = win32.DispatchEx("Word.Application")
filedoc='c:\\growthtech\\Capturar6.docx'
filepdf='c:\\growthtech\\Capturar6.pdf'
in_file = path.abspath(filedoc)
out_file = path.abspath(filepdf)
doc = word.Documents.Open(in_file, 'rb')
doc.SaveAs(new_file, FileFormat=17)
doc.Close()
word.Quit()
在“doc=word.Documents.Open打开(在_文件中,'rb')”。在
^{pr2}$谢谢你的帮助。在
这应该是有效的:
相关问题 更多 >
编程相关推荐