PHP COM应用之WPS篇
本文仅仅是一个简单的例子来演示PHP通过COM扩展来调用WPS二次开发接口.
<?php $wps = new COM("WPS.application") or die("Can't start WPS"); try { $wps->Visible = true; // Create Document $doc = $wps->Documents->Add(); $doc->Range->Text = "WPS v{$wps->Version} Example"; $doc->Paragraphs[1]->Alignment = 1; $doc->Shapes->AddPicture("http://img.kingsoft.com/publish/kingsoft/images/gb/sy/logo.gif", 80, 50, 148, 60); $doc->SaveAs("c:/php.wps"); // Close $wps->Quit(); } catch (com_exception $e) { echo $e; } ?>

