79ab852bf5
We used to have some kind of wrapper that didn't do much except forward methods to the real instance. That unnecessary complexity made it harder to work with the real writer instance.
21 lines
672 B
PHP
21 lines
672 B
PHP
<?php
|
|
|
|
use PhpOffice\PhpSpreadsheet\Settings;
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
|
|
|
|
require __DIR__ . '/../Header.php';
|
|
$spreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';
|
|
|
|
$helper->log('Hide grid lines');
|
|
$spreadsheet->getActiveSheet()->setShowGridLines(false);
|
|
|
|
$helper->log('Set orientation to landscape');
|
|
$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE);
|
|
|
|
$rendererName = \PhpOffice\PhpSpreadsheet\Writer\Pdf\TcPDF::class;
|
|
$helper->log("Write to PDF format using {$rendererName}");
|
|
Settings::setDefaultPdfWriter($rendererName);
|
|
|
|
// Save
|
|
$helper->write($spreadsheet, __FILE__, ['Pdf']);
|