I want to count the number of pages of .doc file. I have used ZipArchive()
but its works only for .docx
and also used linux command
"vSummary sample.doc | grep -oP '(?<=of Pages = )[ A-Za-z0-9]*'
but its also not works. Can anyone give mw to solution for get page count for .doc file in PHP.
$zip = new ZipArchive();
if($zip->open($file) === true) {
if(($index = $zip->locateName('docProps/app.xml')) !== false)
{
$data = $zip->getFromIndex($index);
$zip->close();
$xml = new SimpleXMLElement($data);
print_r($xml);
$pageCount= $xml->Pages;
}
$zip->close();
}
And also used of linux command :
wvSummary sample.doc | grep -oP '(?<=of Pages = )[ A-Za-z0-9]*'
But not working