18 parent::__construct($spreadsheet);
41 public function save($pFilename): void
50 $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
52 $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
53 $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins();
57 $printPaperSize = $this->spreadsheet->getSheet($this->
getSheetIndex())->getPageSetup()->getPaperSize();
58 $printMargins = $this->spreadsheet->getSheet($this->
getSheetIndex())->getPageMargins();
72 if (isset(self::$paperSizes[$printPaperSize])) {
73 $paperSize = self::$paperSizes[$printPaperSize];
78 $pdf->setFontSubsetting(
false);
80 $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72);
81 $pdf->SetAutoPageBreak(
true, $printMargins->getBottom() * 72);
83 $pdf->setPrintHeader(
false);
84 $pdf->setPrintFooter(
false);
90 $pdf->writeHTML($this->generateHTMLAll());
93 $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle());
94 $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator());
95 $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject());
96 $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords());
97 $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator());
102 parent::restoreStateAfterSave();
save($pFilename)
Save Spreadsheet to file.
__construct(Spreadsheet $spreadsheet)
Create a new PDF Writer instance.
getSheetIndex()
Get sheet index.
getPaperSize()
Get Paper Size.
const ORIENTATION_LANDSCAPE
getOrientation()
Get Orientation.
createExternalWriterInstance($orientation, $unit, $paperSize)
Gets the implementation of external PDF library that should be used.
setUseInlineCss($pValue)
Set use inline CSS?