set_time_limit(0); $wps = new COM("WPS.Application"); $src_filename="D:\PHPnow-1.5.6\htdocs\a.docx"; //源文件,DOC 或者 WPS 都可以 $pdf_filename="D:/PHPnow-1.5.6/htdocs/a.pdf"; //欲转 PDF 的文件名 //打开文件 $doc = $wps->Documents->Open($src_filename); //文件另存为pdf $doc->exportpdf($pdf_filename); //关闭WPS对象 $doc->Close(); unset( $doc , $wps ); $WshShell = new COM("WScript.Shell"); $command= "c:\SWFTools\pdf2swf.exe -t D:\PHPnow-1.5.6\htdocs\a.pdf -o D:\PHPnow-1.5.6\htdocs\a.swf -f -T 9 "; $oExec = $WshShell->Run("cmd /C ". $command, 0, true); |
转载于:https://my.oschina.net/u/563647/blog/136530