Home > php教程 > PHP源码 > PHP Word & Excel 转 PDF

PHP Word & Excel 转 PDF

PHP中文网
Release: 2016-05-25 16:58:47
Original
1750 people have browsed it

Word 转 PDF  

function wd2pdf($ori, $dst)
{
	$winword = new COM('Word.Application');
	$document = $winword->Documents->Open($ori);
	$document->ExportAsFixedFormat($dst, 17);
	$document->Close();
	$winword->Quit();
}
Copy after login

Excel 转 PDF

function xl2pdf($ori, $dst)
{
	$excel = new COM('Excel.Application');
	$workbook = $excel->Workbooks->Open($ori);
	$workbook->ExportAsFixedFormat(0, $dst);
	$workbook->Close();
	$excel->Quit();
}
Copy after login

                   

                   

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template