当前位置:Gxlcms > PHP教程 > PHPWord&Excel转PDF

PHPWord&Excel转PDF

时间:2021-07-01 10:21:17 帮助过:3人阅读

Windows + Microsoft Office 2013 only!




  1. function wd2pdf($ori, $dst)
  2. {
  3. $winword = new COM('Word.Application');
  4. $document = $winword->Documents->Open($ori);
  5. $document->ExportAsFixedFormat($dst, 17);
  6. $document->Close();
  7. $winword->Quit();
  8. }



  1. function xl2pdf($ori, $dst)
  2. {
  3. $excel = new COM('Excel.Application');
  4. $workbook = $excel->Workbooks->Open($ori);
  5. $workbook->ExportAsFixedFormat(0, $dst);
  6. $workbook->Close();
  7. $excel->Quit();
  8. }

人气教程排行