幕布斯91280836
2021-07-17 17:51
import os
from win32com.client import constants,gencache
def createpdf(wordPath, pdfPath):
word =gencache.EnsureDispatch('Word.Application')
doc = word.Documents.Open(wordPath, ReadOnly=1)
doc.ExportAsFixedFormat(pdfPath, constants.wdExportFormatPDF)
word.Quit()
createpdf('D:/jw/study/python/writeexcel/info.docx','D:/jw/study/python/writeexcel/info.pdf')还没有人回答问题,可以看看其他问题
Python办公自动化
50234 学习 · 163 问题
相似问题