27    public function save($pFilename): void
 
   36            $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
 
   38            $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
 
   42            $printPaperSize = $this->spreadsheet->getSheet($this->
getSheetIndex())->getPageSetup()->getPaperSize();
 
   59        if (isset(self::$paperSizes[$printPaperSize])) {
 
   60            $paperSize = self::$paperSizes[$printPaperSize];
 
   64        $config = [
'tempDir' => $this->tempDir . 
'/mpdf'];
 
   69        $pdf->AddPageByArray([
 
   71            'margin-left' => $this->
inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getLeft()),
 
   72            'margin-right' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getRight()),
 
   73            'margin-top' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getTop()),
 
   74            'margin-bottom' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getBottom()),
 
   78        $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle());
 
   79        $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator());
 
   80        $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject());
 
   81        $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords());
 
   82        $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator());
 
   84        $html = $this->generateHTMLAll();
 
   85        foreach (\array_chunk(\explode(
PHP_EOL, 
$html), 1000) as $lines) {
 
   92        parent::restoreStateAfterSave();
 
  104        return $inches * 25.4;
 
An exception for terminatinating execution or to throw for unit testing.
Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:.
const ORIENTATION_LANDSCAPE
const ORIENTATION_DEFAULT
const ORIENTATION_PORTRAIT
getSheetIndex()
Get sheet index.
inchesToMm($inches)
Convert inches to mm.
createExternalWriterInstance($config)
Gets the implementation of external PDF library that should be used.
save($pFilename)
Save Spreadsheet to file.
getPaperSize()
Get Paper Size.
getOrientation()
Get Orientation.
setOrientation($pValue)
Set Orientation.