Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32com.client
- docx = "C:\\Users\\xwk\\Desktop\\12.docx"
- pdf1 = "C:\\Users\\xwk\\Desktop\\12.pdf"
- xlsx = "C:\\Users\\xwk\\Desktop\\22.xlsx"
- pdf2 = "C:\\Users\\xwk\\Desktop\\22.pdf"
- wpsFormatPdf = 17
- wps = win32com.client.Dispatch("KWPS.Application")
- doc = wps.Documents.Open(docx)
- doc.SaveAs(pdf1, wpsFormatPdf)
- doc.Close()
- wps.Quit()
- et = win32com.client.Dispatch('KET.Application.9')
- workbook = et.Workbooks.Open(xlsx)
- workbook.ExportAsFixedFormat(0, pdf2)
- workbook.Close()
- et.Quit()
Add Comment
Please, Sign In to add comment