I have a PDF file. I would to get it height and width in mm.
So I do an exec(pdfinfo ... ); I have this result :
Creator: Adobe InDesign CS5 (
Why not use plain PHP to get the pdf dimensions?
eof()) {
if (preg_match("/".$box."\[[0-9]{1,}.[0-9]{1,} [0-9]{1,}.[0-9]{1,} ([0-9]{1,}.[0-9]{1,}) ([0-9]{1,}.[0-9]{1,})\]/", $stream->fgets(), $matches)) {
$result["width"] = $matches[1];
$result["height"] = $matches[2];
break;
}
}
$stream = null;
return $result;
}
var_dump(get_pdf_dimensions("file.pdf"));