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 php.net) 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 and can be found here : http://www.foolabs.com/xpdf/download.html) . any other solution will be accepted as far as it gives to me text output of the pdf (the correct one)
3
-
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...octern– octern2012-04-18 22:43:23 +00:00Commented Apr 18, 2012 at 22:43
-
@octern i dont know vary much about pdf (and im not interesed in) so i cant figure out why they didnt workAlbi– Albi2012-04-18 22:45:14 +00:00Commented Apr 18, 2012 at 22:45
-
already found another one . was the last chanceAlbi– Albi2012-04-20 12:00:58 +00:00Commented Apr 20, 2012 at 12:00
Add a comment
|
1 Answer
Since you have a restricted environment, you may want to look at this. http://webcheatsheet.com/php/reading_clean_text_from_pdf.php
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.
3 Comments
Albi
i have took a look at that website for 3 looooong nights and in the end i got nothing to call a solution to my problem . that function worked partially but not for some pdf files
Abhinav Singh
As i said, i m not too sure how stable that code is. Does your server support popen class of functions (i doubt)? That will be another way of doing it with pdf2text.
Rick Hellewell
As of 2022-Jul-2, the WebCheatSheet.com site doesn't work (in http or https).