diff --git a/doc/Usage.md b/doc/Usage.md index 398c243c..0abbbf00 100644 --- a/doc/Usage.md +++ b/doc/Usage.md @@ -224,6 +224,10 @@ $pages = $pdf->getPages(); $mediaBox = []; foreach ($pages as $page) { $details = $page->getDetails(); + // The page could haven't the Mediabox, then we get this information from document + if (!isset($details['MediaBox'])) { + $details = reset($pdf->getObjectsByType('Pages'))->getHeader()->getDetails(); + } $mediaBox[] = [ 'width' => $details['MediaBox'][2], 'height' => $details['MediaBox'][3]