2017-01-21 15:44:33 +00:00
|
|
|
<?php
|
|
|
|
|
2017-05-17 22:02:17 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Settings;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
|
|
|
|
|
2017-10-01 08:48:59 +00:00
|
|
|
require __DIR__ . '/../Header.php';
|
|
|
|
$spreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';
|
2017-01-21 15:44:33 +00:00
|
|
|
|
|
|
|
$helper->log('Hide grid lines');
|
|
|
|
$spreadsheet->getActiveSheet()->setShowGridLines(false);
|
|
|
|
|
|
|
|
$helper->log('Set orientation to landscape');
|
2017-05-17 22:02:17 +00:00
|
|
|
$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE);
|
2017-01-21 15:44:33 +00:00
|
|
|
|
2017-10-14 05:57:44 +00:00
|
|
|
$rendererName = \PhpOffice\PhpSpreadsheet\Writer\Pdf\MPDF::class;
|
2017-01-21 15:44:33 +00:00
|
|
|
$helper->log("Write to PDF format using {$rendererName}");
|
2017-10-14 05:57:44 +00:00
|
|
|
Settings::setDefaultPdfWriter($rendererName);
|
2017-01-21 15:44:33 +00:00
|
|
|
|
|
|
|
// Save
|
2017-01-22 08:39:23 +00:00
|
|
|
$helper->write($spreadsheet, __FILE__, ['Pdf']);
|