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();
- }
复制代码
|