Task #1043

Unable to open saved PDF in Acrobat Reader

Added by Joseph Kulandai 11 months ago. Updated 7 months ago.

Start date:
Due date:
% Done:


Estimated time:



I am using TCPDF Advanced Table.

I create a simple PDF with a header and footer. Its working good and I am able to view the PDF in browser (Chrome). I downloaded the PDF and unable to open it in Acrobat. I get an error as "There was an error opening this document. The file is damaged and could not be repaired"

Then I ran the example (tcpdf_table\example-table-2-overview.php) that you have given in the bundle. I get the same problem with this also. Able to see in browser but not able to ope in Acrobat reader.

Then, this same example (Pdf example #2:) is hosted in your website (, exactly the same code, it works good. I am able to download it and open in Acrobat Reader.

Instead of streaming to browser, I saved it in disk. Then also the same issue repeats.

If your example tcpdf_table\example-table-2-overview.php works for me, then I can port it to my code. Do I need to make any changes to it?

I have spent significant amount of time on this. Please help me.


Screenshot_98.png View Screenshot_98.png 65.4 KB Andrei Bintintan, 12/20/2016 09:47 AM


#1 Updated by Andrei Bintintan 11 months ago

  • Status changed from New to In Progress
  • Assignee set to Joseph Kulandai

This is strange, I can reproduce it. I will investigate.

#2 Updated by Andrei Bintintan 11 months ago


Resolution: Please delete the _putinfo() function from the classes/pdf.php file.
This function is used by unit-tests, but it seems indeed to break the pdf. I'll review and release a fix.

Please let me know if it fixed your issue.

#3 Updated by Andrei Bintintan 11 months ago

Or replace it with:

    protected function _putinfo()
        if ( defined( 'ENVIRONMENT' ) && 'test' == ENVIRONMENT ) {
            $this->file_id = '1234567890';
            $this->tcpdf_version = "1.0.0";

        return parent::_putinfo();

#4 Updated by Andrei Bintintan 11 months ago

Changes released, please make an update.

#5 Updated by Andrei Bintintan 11 months ago

  • Status changed from Feedback to Closed

#6 Updated by Andrei Bintintan 7 months ago

  • Tracker changed from Support to Task

Also available in: Atom PDF