29 error_reporting(E_ALL);
30 ini_set(
'display_errors', TRUE);
31 ini_set(
'display_startup_errors', TRUE);
32 date_default_timezone_set(
'Europe/London');
34 if (PHP_SAPI ==
'cli')
35 die(
'This example should only be run from a Web Browser');
38 require_once dirname(__FILE__) .
'/../Classes/PHPExcel.php';
56 $objPHPExcel->getProperties()->setCreator(
"Maarten Balliauw")
57 ->setLastModifiedBy(
"Maarten Balliauw")
58 ->setTitle(
"PDF Test Document")
59 ->setSubject(
"PDF Test Document")
60 ->setDescription(
"Test document for PDF, generated using PHP classes.")
61 ->setKeywords(
"pdf php")
62 ->setCategory(
"Test result file");
67 ->setCellValue(
'A1',
'Hello')
68 ->setCellValue(
'B2',
'world!')
69 ->setCellValue(
'C1',
'Hello')
70 ->setCellValue(
'D2',
'world!');
74 ->setCellValue(
'A4',
'Miscellaneous glyphs')
75 ->setCellValue(
'A5',
'éàèùâêîôûëïüÿäöüç');
90 'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
92 'at the top of this script as appropriate for your directory structure' 98 header(
'Content-Type: application/pdf');
99 header(
'Content-Disposition: attachment;filename="01simple.pdf"');
100 header(
'Cache-Control: max-age=0');
static setPdfRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering PDF files.
$rendererName
Include PHPExcel.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Add a drawing to the header