53 parent::__construct($phpExcel);
62 public function save($pFilename = NULL)
64 $fileHandle = parent::prepareForSave($pFilename);
67 $paperSize =
'LETTER';
71 $orientation = ($this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation()
75 $printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
76 $printMargins = $this->_phpExcel->getSheet(0)->getPageMargins();
78 $orientation = ($this->_phpExcel->getSheet($this->
getSheetIndex())->getPageSetup()->getOrientation()
82 $printPaperSize = $this->_phpExcel->getSheet($this->
getSheetIndex())->getPageSetup()->getPaperSize();
83 $printMargins = $this->_phpExcel->getSheet($this->
getSheetIndex())->getPageMargins();
93 $orientation = strtoupper($orientation);
100 if (isset(self::$_paperSizes[$printPaperSize])) {
101 $paperSize = self::$_paperSizes[$printPaperSize];
106 $ortmp = $orientation;
107 $pdf->_setPageSize(strtoupper($paperSize), $ortmp);
108 $pdf->DefOrientation = $orientation;
109 $pdf->AddPage($orientation);
112 $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
113 $pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
114 $pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
115 $pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
116 $pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
125 fwrite($fileHandle,
$pdf->Output(
'',
'S'));
127 parent::restoreStateAfterSave($fileHandle);
__construct(PHPExcel $phpExcel)
Create a new PHPExcel_Writer_PDF.
const ORIENTATION_DEFAULT
static getPdfRendererPath()
Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use...
getOrientation()
Get Orientation.
generateHTMLHeader($pIncludeStyles=false)
Generate HTML header.
getSheetIndex()
Get sheet index.
const ORIENTATION_LANDSCAPE
$pdfRendererClassFile
Require mPDF library.
getPaperSize()
Get Paper Size.
setOrientation($pValue=PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
Set Orientation.
save($pFilename=NULL)
Save PHPExcel to file.
generateSheetData()
Generate sheet data.
const ORIENTATION_PORTRAIT
generateHTMLFooter()
Generate HTML footer.