Project

General

Profile

Task #1043

Unable to open saved PDF in Acrobat Reader

Added by Joseph Kulandai 9 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Start date:
12/20/2016
Due date:
% Done:

0%

Estimated time:

Description

Hi,

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 (http://www.interpid.eu/tcpdf-table), 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.

Regards,
Joseph.

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

History

#1 Updated by Andrei Bintintan 9 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 9 months ago

622

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 9 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 9 months ago

Changes released, please make an update. http://www.interpid.eu/download

#5 Updated by Andrei Bintintan 9 months ago

  • Status changed from Feedback to Closed

#6 Updated by Andrei Bintintan 5 months ago

  • Tracker changed from Support to Task

Also available in: Atom PDF