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();
87 $orientation = ($orientation ==
'L') ?
'landscape' :
'portrait';
100 if (isset(self::$_paperSizes[$printPaperSize])) {
101 $paperSize = self::$_paperSizes[$printPaperSize];
107 $pdf->set_paper(strtolower($paperSize), $orientation);
117 fwrite($fileHandle,
$pdf->output());
119 parent::restoreStateAfterSave($fileHandle);
$pdfRendererClassFile
Require DomPDF library.
An exception for terminatinating execution or to throw for unit testing.
static getPdfRendererPath()
Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use.
const ORIENTATION_PORTRAIT
const ORIENTATION_LANDSCAPE
const ORIENTATION_DEFAULT
generateHTMLFooter()
Generate HTML footer.
getSheetIndex()
Get sheet index.
generateHTMLHeader($pIncludeStyles=false)
Generate HTML header.
generateSheetData()
Generate sheet data.
getPaperSize()
Get Paper Size.
getOrientation()
Get Orientation.
save($pFilename=NULL)
Save PHPExcel to file.
__construct(PHPExcel $phpExcel)
Create a new PHPExcel_Writer_PDF.