Tuesday, 13 December 2011

Running our PDF Tool commands on Linux Ubuntu Apache PHP server - PdfPageCount example

e.g. with PdfPageCount   available here: http://www.traction-software.co.uk/servertools/pdfpagecount/index.html

su   to switch to root user

cp PdfPageCount /var/www
cp test5.pdf /var/www
chmod 777 /var/www/*


<?php
echo "<HTML>";

$file = './test5.pdf';
$command = './PdfPageCount ';
$out = shell_exec($command. $file.' > /dev/null; echo $?'  );

echo "Page count: ";
echo $out;

echo "</HTML>";
?>

No comments:

Post a Comment