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

Popular Categories





Php extract text form Pdf.

+1 vote
223 views
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.

Thanks!

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:

include('class.pdf2text.php');
$a = new PDF2Text();
$a->setFilename('test_RFP.pdf'); //give the file name with path
$a->decodePDF();
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,169 views
+1 vote
1 answer 160 views
+1 vote
1 answer 80 views
+1 vote
0 answers 67 views
asked in Programming by amit_pammu Expert (5,030 points)
+4 votes
5 answers 718 views
0 votes
1 answer 9,844 views
+2 votes
3 answers 283 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
2 answers 5,235 views
+2 votes
1 answer 145 views

Not a Member yet?

Ask to Folks Login

My Account
608 Folks are online
87 members and 521 guest online
Your feedback is highly appreciated