PHPEXCEL PDF图书馆

时间:2015-05-29 09:13:47

标签: php mysql pdf

我有一个wamp安装。我已经安装并使用了没有任何问题的PhpExcel库来从一些mysql查询创建excel文件。 现在我想使用PhpExcel创建一些pdf文件。 我已经下载并安装了DomPdf和tcpdf。文件夹位于C:\ wamp \ www中 我发现为了将phpexcel与pdf库一起使用,我必须使用这段代码。

$rendererName = PHPExcel_Settings::PDF_RENDERER_TCPDF
$rendererLibrary = 'tcPDF5.9';
$rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary;

if (!PHPExcel_Settings::setPdfRenderer(
$rendererName,
$rendererLibraryPath
)) {
die(
'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
EOL .
'at the top of this script as appropriate for your directory structure');
} 

我试图在$ rendererLibraryPath中使用每个可能的路径,但我每次都得到的是:

注意:请设置$ rendererName和$ rendererLibraryPath值 在此脚本的顶部,适合您的目录结构。 即使我试图使用phpexcel示例中的21pdf.php,也会出现相同的注意事项。

请帮忙。我花了将近2天的时间。

0 个答案:

没有答案