Albi Patozi
Albi Patozi

Reputation: 1468

convert pdf to text file in php (note : shell_exec is disabled)

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)

Upvotes: 0

Views: 8988

Answers (1)

Abhinav Singh
Abhinav Singh

Reputation: 2651

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.

Upvotes: 3

Related Questions