PHPExcel pdf

PHPExcel pdf - PHP - Programmation

Marsh Posté le 03-05-2013 à 09:08:15    

bonjor,
je n'arrive pas a crée un fichier pdf avec la librérie PHPexcel

Code :
  1. include 'PHPExcel.php';
  2. include 'PHPExcel/Writer/Excel2007.php';
  3. include 'PHPExcel/Writer/PDF.php';
  4. $workbook = new PHPExcel;
  5. $sheet = $workbook->getActiveSheet();
  6. $sheet->setCellValue('C1',blabla);
  7. .....
  8. $writer = new PHPExcel_Writer_PDF($workbook);
  9. $writer->setSheetIndex(0);//Une seule feuille possible
  10. $records = './fichier.pdf';
  11. $writer->save($records);
  12. header('Content-type: application/pdf');
  13. header('Content-Disposition:inline;filename=fichier.pdf');
  14. $writer->save('php://output');


 
 
Uncaught exception 'Exception' with message 'PDF Rendering library has not been defined.' in /public_html/beal/PHPExcel/Writer/PDF.php:49 Stack trace: #0 /public_html/beal/saisie_EPI.php(538): PHPExcel_Writer_PDF->__construct(Object(PHPExcel)) #1 {main} thrown in /public_html/beal/PHPExcel/Writer/PDF.php on line 49

Reply

Marsh Posté le 03-05-2013 à 09:08:15   

Reply

Marsh Posté le 03-05-2013 à 11:43:39    

mais Je charge mes librairies
 
version PHPExcel 1.78
 
il faut presiser les lib comment faire ?
 
 je pence que c'est çà mais j'ai l'erreur suivante:
[B]Fatal error: Class 'PHPExcel_Writer_PDF_tcPDF' not found in /public_html/PHPExcel/Writer/PDF.php on line 64[/B]
 
 
avec:
 
$cheminTCPDF = './PHPExcel/Writer/PDF/tcPDF.php';
PHPExcel_Settings::setPdfRenderer(PHPExcel_Settings::PDF_RENDERER_TCPDF, $cheminTCPDF);
//ou
$cheminTCPDF = '../TCPDF_PATH';
PHPExcel_Settings::setPdfRenderer(PHPExcel_Settings::PDF_RENDERER_TCPDF, $cheminTCPDF);

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed