PhpSpreadsheet/samples/Pdf/21_Pdf_Domdf.php

21 lines
651 B
PHP
Raw Normal View History

<?php
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';
$helper->log('Hide grid lines');
$spreadsheet->getActiveSheet()->setShowGridLines(false);
$helper->log('Set orientation to landscape');
$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE);
$rendererName = Settings::PDF_RENDERER_DOMPDF;
$helper->log("Write to PDF format using {$rendererName}");
Settings::setPdfRendererName($rendererName);
// Save
$helper->write($spreadsheet, __FILE__, ['Pdf']);