I've successfully convert Excel to PDF using this code:
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Tcpdf');
$writer->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
header("Content-Disposition: attachment; filename=test.pdf");
$writer->save('php://output');
My problem is, the Excels has too many columns so the generated PDF crop the data.
Is it possible to either:
I think there's no solution for this. So I just reduce the font size. When my data is small, the paper space will be wasted