"Python" calls the WPS V9 API for PPT to PDF

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.