1

I need to upload files count words and letters of .docx, .doc, and .pdf extensions. I try with help of DOCUNTER but it is not working for me. link: https://github.com/joeblurton/doccounter.

include "class.doccounter.php";

$doc = new DocCounter();
$doc->setFile("sample.pdf");

print_r($doc->getInfo());
echo $doc->getInfo()->wordCount;

The result is not found by this code in PHP

Dhara Talaviya
  • 572
  • 7
  • 10
  • 1
    That library you tried to use there is marked as “obsolete” by the developer itself, and it says right there on the github page, _“Users found too much variance in the output with different save files. I recommend using the LibreOffice cli tools to achieve the same ends.”_ - so look into that, maybe. – CBroe Mar 03 '21 at 13:18
  • I need in PHP so I think it is in java and c++ – Dhara Talaviya Mar 03 '21 at 13:58
  • Then you will have to go and find yourself something in PHP, that actually works. Asking for recommendations on libraries is explicitly considered off-topic here. – CBroe Mar 03 '21 at 14:02
  • https://stackoverflow.com/questions/17967828/php-get-a-word-count-from-an-uploaded-microsoft-word-document – Anurat Chapanond Mar 03 '21 at 15:00
  • I have already tried with but not working with PDF wordcount and .doc wordcount – Dhara Talaviya Mar 04 '21 at 05:42

0 Answers0