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\MPDF::class; $helper->log("Write to PDF format using {$rendererName}"); Settings::setDefaultPdfWriter($rendererName); // Save $helper->write($spreadsheet, __FILE__, ['Pdf']);