Actually, I am trying to count pages from ms word file, I am using this php script, but without showing me the exact result, and the script is not working so fast. Can anyone help me 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);
source share