Hey there! any question in your mind? Ask It Now!.

Popular Categories

Php extract text form Pdf.

+1 vote
asked in Programming by amit_pammu Expert (5,030 points)
I want to extract emails or a particular text from the pdf files in php.Please suggest me some well class or lib.


2 Answers

0 votes
answered by Nathanael Lantz
if you are referring to parsing a pdf with php, yes and no. I've never heard of php being able to do this natively, but there are libraries / plugins available for this.
in my experience I have mostly just built pdf's from html so I may be wrong.
0 votes
answered by Mona sah

You can follow these steps :

Step 1. create a file with the name class.pdf2text.php

Now paste the code below in this file:

Paste code from here

Step 2. In a another file just write the below code:

$a = new PDF2Text();
$a->setFilename('test_RFP.pdf'); //give the file name with path
echo $a->output(); 


I hope this will help you , because when I was testing this  code it was not working for some of pdfs.

commented by amit_pammu Expert (5,030 points)
thanks for your answer , But I have already tried this , its not working
commented by nitin (810 points)
if you want to extract data FROM a PDF file then you need some sort of PDF Parser, I would recommend https://github.com/smalot/pdfparser

Related Questions

+5 votes
1 answer 1,240 views
+1 vote
0 answers 101 views
asked in Programming by amit_pammu Expert (5,030 points)
+2 votes
3 answers 363 views
+1 vote
2 answers 6,544 views
+2 votes
1 answer 224 views
+1 vote
2 answers 184 views

Not a Member yet?

Ask to Folks Login

My Account
348 Folks are online
2 members and 346 guest online
Your feedback is highly appreciated