PHPWord&Excel转PDF
时间:2021-07-01 10:21:17
帮助过:3人阅读
Windows + Microsoft Office 2013 only!
- function wd2pdf($ori, $dst)
- {
- $winword = new COM('Word.Application');
- $document = $winword->Documents->Open($ori);
- $document->ExportAsFixedFormat($dst, 17);
- $document->Close();
- $winword->Quit();
- }
- function xl2pdf($ori, $dst)
- {
- $excel = new COM('Excel.Application');
- $workbook = $excel->Workbooks->Open($ori);
- $workbook->ExportAsFixedFormat(0, $dst);
- $workbook->Close();
- $excel->Quit();
- }
|