Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Memory limit fatal error with compressed PDF #27

@MallauryGerard

Description

@MallauryGerard

Hello,

Here is the code that trigger a memory limit fatal error :

require_once base_path('vendor/tecnickcom/tcpdf/tcpdf.php');
require_once base_path('vendor/propa/tcpdi/tcpdi.php');
$pdf = new \TCPDI();
$nb_pages = $pdf->setSourceFile(base_path('/public/uploads/' . $document->url)); // HERE !!!

The stack trace shows that the error comme from the tcpdi_parser.php file in this method :

protected function getRawObject($offset=0, $data=null) {
//
}

I think the problem come to the compression method, which is FlateDeflate.

Here are 2 problematic PDF :
document1
document2

I host thousands of pdf files shared by several people, so it's impossible for me to know whether they've compressed them or not. Is there a solution?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions