You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
667 B
21 lines
667 B
4 years ago
|
<?php
|
||
|
|
||
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||
|
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);
|
||
|
|
||
|
$className = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf::class;
|
||
|
$helper->log("Write to PDF format using {$className}");
|
||
|
IOFactory::registerWriter('Pdf', $className);
|
||
|
|
||
|
// Save
|
||
|
$helper->write($spreadsheet, __FILE__, ['Pdf']);
|