Heim  >  Artikel  >  php教程  >  PHP Word & Excel 转 PDF

PHP Word & Excel 转 PDF

PHP中文网
PHP中文网Original
2016-05-25 16:58:471634Durchsuche

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

                   

                   

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:更改xhEditor 上传文件upload.phpNächster Artikel:jpgraph 图表