Home  >  Article  >  php教程  >  PHP Word & Excel 转 PDF

PHP Word & Excel 转 PDF

PHP中文网
PHP中文网Original
2016-05-25 16:58:471635browse

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();
}

                   

                   

Statement:
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
Previous article:更改xhEditor 上传文件upload.phpNext article:jpgraph 图表