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.
Python calls com to install Python for Windows Extensions, which is Pywin32
The call is simple, the direct code:
ImportSYSImportOSImportWin32com.clientstat= Os.system ('taskkill/im Wps.exe') argc=Len (SYS.ARGV)Print("Number of arguments:", ARGC,'arguments.')Print('Argument List:', str (SYS.ARGV))ifARGC < 2: Sys.exit (-1) src= Sys.argv[1];d St= Sys.argv[2];o= Win32com.client.Dispatch ("kwps.application") o.visible=Falsedoc=o.documents.open (SRC);d oc. ExportAsFixedFormat (DST,17) O.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/4897744.html
"Python" calls the WPS V9 API for Word to PDF