the best way to solve this was to use "pdftotext" that is in the "xpdf" package but in all shared hosts that i googled shell_exec is disabled . i found alternative metods that used only php like a function called pdf2string() (on but none of those functions didn't work as expected (with some pdf files they just didn't output correct text and with some other pdf they didn't output nothing and some other versions of this function just didnt work at all so i excluded this option). any way to convert that open source pdftotext into a php script ? (source is in c++ i think. any other solution will be accepted as far as it gives to me text output of the pdf (the correct one)

convert pdf to text file in


Since you have a restricted environment, you may want to look at this.

This uses no external library to parse pdf to text formats. However, since this parse text out of raw pdf format, i m not sure how stable it is.

Probably the best solution is to figure out why the PHP libraries you tried didn't work. You should specify the ones you used and what happened with each one. It's much more likely that you'll be able to find someone who knows how they work and how to fix your problem than that you'll find someone who wants to reimplement pdftotext in PHP.