开发者

How to extract text from the PDF document? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_JAVA百科

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

How to extract text from the PDF document using PHP?

(I can't use other tools, I don't have root access)

I've found some functions working for plain text, but they don't handle well Unicode characters:

http://www.hashbangcode.com/blog/zend-lucene-and-pdf-documents-part-2-pdf-data-extraction-437.html


Download the class.pdf2text.php @ https://pastebin.com/dvwySU1a or https://webcheatsheet.com/php/scripts/pdf2text.zip

Code:

include('class.pdf2text.php');
$a = new PDF2Text();
$a->setFilename('filename.pdf'); 
$a->decodePDF();
echo $a->output(); 

  • class.pdf2text.php Project Home
  • pdf2textclass doesn't work with all the PDF's I've tested, If it doesn't work for you, try PDF Parser
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜