WPS API, that is, COM, mainly divided into V8 and V9 two versions, the online easy to find examples, are V8. Now the official online can download, 2013 Rob Fresh version, is V9 API, the following code is based on V9.
Python calls com to install Python for Windows Extensions, which is Pywin32
The call is simple, the direct code:
ImportSYSImportOSImportWIN32COM.CLIENTARGC=Len (SYS.ARGV)Print("Number of arguments:", ARGC,'arguments.')Print('Argument List:', str (SYS.ARGV))ifARGC < 2: Sys.exit (-1) src= Sys.argv[1]DST= Sys.argv[2]WPP= Win32com.client.Dispatch ("kwpp.application")#O.visible=falseppt =WPP. Presentations.Open (SRC) ppt. SaveAs (DST,32) ppt. Close () WPP. Quit () sys.exit (0)
When called:
xxx.py "src" "DST"
The first parameter is a source path
The second parameter is the destination path
This address: http://www.cnblogs.com/gaoshang212/p/4896539.html
"Python" calls the WPS V9 API for PPT to PDF