Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 688327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:13:06+00:00 2026-05-14T02:13:06+00:00

I have go TCPDF setup in my cake php install and am now trying

  • 0

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 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:13:07+00:00Added an answer on May 14, 2026 at 2:13 am

    I am not sure how you added the FPDI and TCPDF to your cake app. I had some problems when I was doing something similar. I realized what you need to do is import TCPDF then FPDI and then make XTCPDF extend FPDI.

    So, in my vendors folder I have a a xtcpdf.php file, which looks like the following:

    <?php
    App::import('Vendor','tcpdf/tcpdf');
    App::import('Vendor','fpdi/fpdi');
    
    class XTCPDF  extends FPDI {
    
    function header() {}
    function footer() {}
    
    #other custom methods...
    
    ?>
    

    Because FPDI already extends TCPDF you gain access to TCPDF by including FPDI…

    I did notice that when trying to use the TCPDF’s StartTransaction, CommitTransaction and rollbackTransaction, it caused errors. I have not found out why this is, but I would get an error about accessing private methods, (I think, it was a little while ago I tried) anyway, everything else seems to work great.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used TCPDF in the past to generate PDF's on-the-fly. Now I need
I'm creating PDF files with PHP using TCPDF. I have a small problem with
I'm using tcpdf to generate PDF files with PHP and I have no problem
For some reason the HTML2PDF/TCPDF is not rendering the PDF... and I have no
I have to generate a PDF with TCPDF, my information come from my database,
Today I started experimenting with PHP-based PDF generators. I tried TCPDF and it works
I have been using TCPDF for sometime. It's simple to use, outputs low size
I have a PHP application that needs to generate some PDF invoices and PDF
I have a PHP project where I am opening up a premade PDF, and
I'm trying to convert the first page of a PHP generated PDF to an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.