2017-01-21 15:44:33 +00:00
|
|
|
<?php
|
|
|
|
|
2017-10-21 16:54:14 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
2017-05-17 22:02:17 +00:00
|
|
|
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-21 16:54:14 +00:00
|
|
|
$className = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf::class;
|
|
|
|
$helper->log("Write to PDF format using {$className}");
|
|
|
|
IOFactory::registerWriter('Pdf', $className);
|
2017-01-21 15:44:33 +00:00
|
|
|
|
|
|
|
// Save
|
2017-01-22 08:39:23 +00:00
|
|
|
$helper->write($spreadsheet, __FILE__, ['Pdf']);
|