0

I have a task where I want to extract the dimensions in pixels of each page. The pages of this pdf are all images. I tried to use pdfParser but this does not give the details per page. Is there a way around this?

danielE
  • 21
  • 3
  • You could use exec command with maybe ghostscript or some other alternative that could output the size. Check this out: https://stackoverflow.com/questions/2943281/using-ghostscript-to-get-page-size – Patrick Aug 08 '22 at 09:28

1 Answers1

0

You can use Imagick

<?php
$im = new Imagick();
$im->readImage( "test.pdf[<< page number>>]" );
?>

https://www.php.net/manual/en/book.imagick.php

Maen
  • 725
  • 7
  • 10