How to configure phpexcel for pdf

后端 未结 2 854
傲寒
傲寒 2020-12-17 05:16

i\'ve been searching in the official docs but i can\'t seem to put all the things together in my mind (i\'m new to programming). I managed to use the excel library and it\'s

2条回答
  •  庸人自扰
    2020-12-17 05:54

    Download tcpdf library from https://sourceforge.net/projects/tcpdf/files/ and extract to your porject folder (i have extracted in to xampp\htdocs\export\tcpdf)

    require_once 'PHPExcel/Classes/PHPExcel/IOFactory.php';
    require_once 'PHPExcel/Classes/PHPExcel.php';
    
    // Create new PHPExcel object
    $objPHPExcel = new PHPExcel(); 
    
    $rendererName = PHPExcel_Settings::PDF_RENDERER_TCPDF;
    
    // tcpdf folder path
    $rendererLibraryPath = dirname(__FILE__).'/tcpdf'; 
    

    I found a simple snippet here http://wiki.workassis.com/download-as-pdf-using-phpexcel-and-tcpdf/ phpexcel with tcpdf library

提交回复
热议问题