]> _ Git - cubist_pdf.git/commitdiff
wait #5844
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Apr 2023 09:19:17 +0000 (11:19 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Apr 2023 09:19:17 +0000 (11:19 +0200)
src/PDFTools.php

index f4a2f4a13ed64e09bacfd8e48ef083d652474b87..af58cb5463c1bca869c18b6e5b247c9746b74d7a 100644 (file)
@@ -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 = [];