- //Word 转 PDF
- function wd2pdf($ori, $dst)
- {
- $winword = new COM('Word.Application');
- $document = $winword->Documents->Open($ori);
- $document->ExportAsFixedFormat($dst, 17);
- $document->Close();
- $winword->Quit();
- }
- //Excel 转 PDF
- function xl2pdf($ori, $dst)
- {
- $excel = new COM('Excel.Application');
- $workbook = $excel->Workbooks->Open($ori);
- $workbook->ExportAsFixedFormat(0, $dst);
- $workbook->Close();
- $excel->Quit();
- }
- //该片段来自于http://www.codesnippet.cn/detail/190620149824.html
来源: http://www.codesnippet.cn/detail/190620149824.html