Generate pdf from .xlsx

Jun 19, 2013 at 4:23 PM
Edited Jun 19, 2013 at 4:36 PM
Is that possible to conserve all format (resultat of formulas, header and footer, image) when converting a .xlsx to .pdf? Which 3rd party (mpdf or tcpdf or dompdf) should we use?
My serveral code is in the following:
    $rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF;
    $rendererLibrary = 'mpdf';

    $rendererLibraryPath = '../includes/PHPExcel_1.7.9/'. $rendererLibrary;
    if (!PHPExcel_Settings::setPdfRenderer(
        $rendererName,
        $rendererLibraryPath
    )) {
        die(
        'Please set the $rendererName and $rendererLibraryPath values' .
        PHP_EOL .
        ' as appropriate for your directory structure'
        );
    }
    $header = PHPExcel_IOFactory::createReader('Excel2007');
    $obPHPExcel = $header->load($pathFile.'/Bilan de puissance.xlsx');

    $objWriterPDF = new PHPExcel_Writer_PDF($obPHPExcel);
    $objWriterPDF->save("test.pdf");
It can't keep the header, image and formulas's result
Coordinator
Jun 25, 2013 at 3:25 PM
Not until such time as I (or somebody) writes the code for handling headers and footers in HTML and PDF output
Jun 26, 2013 at 9:34 AM
Thanks very much Mr.Mark :) wish the next version will solve this prob
Coordinator
Jun 26, 2013 at 10:19 AM
Unlikely to be the next version, which is a rewrite to simplify the structure of the code and provide speed and memory improvements... it will be sooner rather than later, but likely to need separate code for the different PDF renderers, so may be done one at a time.