From: Vincent Vanwaelscappel Date: Thu, 6 Apr 2023 09:19:17 +0000 (+0200) Subject: wait #5844 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0fcb3e450a7d05345d7dc1ebabad071ad88c71de;p=cubist_pdf.git wait #5844 --- diff --git a/src/PDFTools.php b/src/PDFTools.php index f4a2f4a..af58cb5 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -40,6 +40,18 @@ class PDFTools { } } + + public static function getDimensions($pdf) { + $infos = self::infos($pdf); + $res = ['size' => $infos['infos']['size'], 'max' => [0, 0], 'totalHeight' => 0]; + foreach ($infos['infos']['page'] as $page) { + $res['max'][0] = max($res['max'][0], $page['size'][0]); + $res['max'][1] = max($res['max'][1], $page['size'][1]); + $res['totalHeight'] += $page['size'][1]; + } + return $res; + } + protected static function parseInfos($data) { $res = [];