Using TCPDF and FPDI with cake php
- by kwhohasamullet
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