Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory limit fatal error with compressed PDF #27

Open
MallauryGerard opened this issue Aug 13, 2023 · 0 comments
Open

Memory limit fatal error with compressed PDF #27

MallauryGerard opened this issue Aug 13, 2023 · 0 comments

Comments

@MallauryGerard
Copy link

MallauryGerard commented Aug 13, 2023

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!

@MallauryGerard MallauryGerard changed the title Memory limit fatal error with some PDF Memory limit fatal error with compressed PDF Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant