Actually i am trying to count the pages from a ms word file, i am using this php script, But, not showing me the exact result and the script is not so fast. Can anyone help me to get a better script.
$word = new COM("word.application");
if (!$word) {
echo ("Could not initialise MS Word object.\n");
exit(1);
}
$word->Documents->Open(realpath("d:\\Test\\t.docx"));
$pages = $word->ActiveDocument->BuiltInDocumentProperties(14);
echo "Number of pages: " . $pages->value;
$word->ActiveDocument->Close(false);
$word->Quit();
$word = null;
unset($word);