/** * Instantiate a new renderer of the configured type within this container class * * @param PHPExcel $phpExcel PHPExcel object * @throws Exception when PDF library is not configured */ public function __construct(PHPExcel $phpExcel) { $pdfLibraryName = \PHPExcel\Settings::getPdfRendererName(); if (is_null($pdfLibraryName)) { throw new Exception("PDF Rendering library has not been defined."); } $pdfLibraryPath = \PHPExcel\Settings::getPdfRendererPath(); if (is_null($pdfLibraryName)) { throw new Exception("PDF Rendering library path has not been defined."); } $includePath = str_replace('\\', '/', get_include_path()); $rendererPath = str_replace('\\', '/', $pdfLibraryPath); if (strpos($rendererPath, $includePath) === false) { set_include_path(get_include_path() . PATH_SEPARATOR . $pdfLibraryPath); } $rendererName = 'PDF\\' . $pdfLibraryName; $this->renderer = new $rendererName($phpExcel); }
<?php namespace PHPExcel\Writer\PDF; /** Require DomPDF library */ $pdfRendererClassFile = \PHPExcel\Settings::getPdfRendererPath() . '/dompdf_config.inc.php'; if (file_exists($pdfRendererClassFile)) { require_once $pdfRendererClassFile; } else { throw new \PHPExcel\Writer\Exception('Unable to load PDF Rendering library'); } /** * PHPExcel_Writer_PDF_DomPDF * * Copyright (c) 2006 - 2015 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel
<?php namespace PHPExcel\Writer\PDF; /** Require mPDF library */ $pdfRendererClassFile = \PHPExcel\Settings::getPdfRendererPath() . '/mpdf.php'; if (file_exists($pdfRendererClassFile)) { require_once $pdfRendererClassFile; } else { throw new \PHPExcel\Writer\Exception('Unable to load PDF Rendering library'); } /** * PHPExcel_Writer_PDF_mPDF * * Copyright (c) 2006 - 2015 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel
<?php namespace PHPExcel\Writer\PDF; /** Require tcPDF library */ $pdfRendererClassFile = \PHPExcel\Settings::getPdfRendererPath() . '/tcpdf.php'; if (file_exists($pdfRendererClassFile)) { $k_path_url = \PHPExcel\Settings::getPdfRendererPath(); require_once $pdfRendererClassFile; } else { throw new \PHPExcel\Writer\Exception('Unable to load PDF Rendering library'); } /** * PHPExcel_Writer_PDF_tcPDF * * Copyright (c) 2006 - 2015 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *