Using TCPDF and FPDI with cake php

Posted by kwhohasamullet on Stack Overflow See other posts from Stack Overflow or by kwhohasamullet
Published on 2010-03-02T04:05:48Z Indexed on 2010/03/26 11:33 UTC
Read the original article Hit count: 593

Filed under:
|
|
|

Hi Guys,

I have go TCPDF setup in my cake php install and am now trying to also use FPDI with it as i need to add a PDF to the start of the PDF that is being generated.

WHen trying to do this i am using 3 classes

XTCPDF which holds my header data FPDI - FPDI class TCPDF - TCPDF class

and it is setup as so:

XTCPDF extends FPDI FPDI extends TCPDF

When i try and generate a PDF with this using commands from teh FPDI classs i get the following error:

Fatal error: Cannot access protected property XTCPDF::$PDFVersion in C:\Program Files\XAMPP\xampp\htdocs\quote\app\vendors\fpdi\fpdi_pdf_parser.php on line 388

Im thinking this may be a scope problem but im not too sure, i have also tested by changing it around to not include XTCPDF class but the same error occurs,

EDIT: The code that i am using that accesses the FPDI class is:

    $tcpdf->setSourceFile(APP.'webroot'.DS.'img'.DS.'pdf'.DS.'front_cover.pdf');
$frontCover = $tcpdf->importPage(1); 
$tcpdf->useTemplate($frontCover);

Thanks in advance for any help :D

© Stack Overflow or respective owner

Related posts about fpdi

Related posts about tcpdf