diff --git a/lib/Service/PdfParserService.php b/lib/Service/PdfParserService.php index 6c8064456..b6af95da8 100644 --- a/lib/Service/PdfParserService.php +++ b/lib/Service/PdfParserService.php @@ -73,7 +73,8 @@ private function parsePdfOnlyWithPhp(string $filename): array { foreach ($pages as $page) { $details = $page->getDetails(); if (!isset($details['MediaBox'])) { - $details = reset($pdf->getObjectsByType('Pages'))->getHeader()->getDetails(); + $pages = $pdf->getObjectsByType('Pages'); + $details = reset($pages)->getHeader()->getDetails(); } $output['d'][] = [ 'w' => $details['MediaBox'][2],