diff --git a/doc/Usage.md b/doc/Usage.md index 398c243c..787c79fe 100644 --- a/doc/Usage.md +++ b/doc/Usage.md @@ -224,6 +224,11 @@ $pages = $pdf->getPages(); $mediaBox = []; foreach ($pages as $page) { $details = $page->getDetails(); + // If Mediabox is not set in details of current $page instance, get details from the header instead + if (!isset($details['MediaBox'])) { + $pages = $pdf->getObjectsByType('Pages'); + $details = reset($pages)->getHeader()->getDetails(); + } $mediaBox[] = [ 'width' => $details['MediaBox'][2], 'height' => $details['MediaBox'][3]