将world文档转换为PDF文档
作者:互联网
# -*- coding: utf-8 -*- import os from win32com.client import Dispatch path = os.getcwd() old_file_path = path + '\\file\\租房合同.docx' new_file_path = path + '\\file\\new_file\\修改为PDf文档的租房合同.pdf' word = Dispatch('word.Application') doc = word.Documents.Open(old_file_path) doc.SaveAs(new_file_path, 17) doc.Close() word.Quit()
标签:word,doc,PDF,文档,file,path,world,new 来源: https://www.cnblogs.com/zhaoyiguang/p/16694691.html