| 123456789101112131415161718192021222324 |
- <?php
- namespace Helpers;
- class PdfHelper {
- public static function getImageConfig(string $path): array {
- [$image_width, $image_height] = getimagesize($path);
- $width = null;
- $height = null;
- if($image_height > $image_width) {
- $height = "8cm";
- }
- else {
- $width = "100%";
- }
- $contents = file_get_contents($path);
- return compact("width", "height", "contents");
- }
- }
|