2019 m. balandžio 21 d., sekmadienis
phpexcel, pdf
/*
$objWriter = PHPExcel_IOFactory::createWriter($doc, 'HTML');
$objWriter->writeAllSheets();
//$objWriter->generateStyles(false);
//echo $objWriter->generateSheetData();
//exit;
$objWriter->save('php://output'); exit;
$css = <<<HTML
<style>
.navigation {display:none}
.gridlines td {border:0;}
</style>
HTML;
require_once('class/pdf/pdftk.php');
ob_start();
$objWriter->save('php://output');
$excelOutput = ob_get_clean();
$excelOutput = str_replace('</head>', $css.'</head>' , $excelOutput);
pdftk::html2pdf($excelOutput,'aaa.pdf', 'L', 'I');
exit;
*/
PHPExcel_Settings::setPdfRenderer(PHPExcel_Settings::PDF_RENDERER_MPDF,'../composer/vendor/mpdf/mpdf/');
$objWriter = PHPExcel_IOFactory::createWriter($doc, 'PDF');
$objWriter->writeAllSheets();
header('Content-type:Application/pdf');
header('Content-Disposition: inline;filename="export.pdf"');
$objWriter->save('php://output');
exit;
Užsisakykite:
Rašyti komentarus (Atom)
Komentarų nėra:
Rašyti komentarą