0

I wrote a simple code in PHP that pulls photos from pdf.

$command = "/usr/bin/pdfimages 'uploads/afawefq3wwe57c027661deba.pdf' -j uploads/pdftoimages57c027661e274";
$exec = shell_exec($command);
echo shell_exec('identify -format "%x x %y" uploads/pdftoimages57c027661e274-001.jpg');

Console test code:

identify -format "%f  Page %s:   Width: %W -- Height: %H ------- %x %y \n" zz.pdf 
zz.pdf  Page 0:   Width: 144 -- Height: 144 ------- 72 72

I need to calculate the DPI image of the pdf file. Every time receives 72 dpi even though the pictures are 600 or 300. If you can somehow do it? If not, what command I use to get the pdf size in inches?

bradley546994
  • 630
  • 2
  • 12
  • 30

0 Answers0