From 0fcb3e450a7d05345d7dc1ebabad071ad88c71de Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 6 Apr 2023 11:19:17 +0200 Subject: [PATCH] wait #5844 --- src/PDFTools.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 = []; -- 2.39.5