Reading PDF Files
XPDF package includes “pdftotext.” You have to install XPDF/pdftotext then run the following PHP statement to get the PDF text:
$txtcontent = exec('/usr/local/bin/pdftotext svnlabs.pdf -');
Reading DOC Files
This package is called Antiword. Here’s the PHP code to grab the Word DOC content:
$txtcontent = exec('/usr/local/bin/antiword svnlabs.doc');