Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a PHP Expert!

Join 244,308 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 808 people online right now. Registration is fast and FREE... Join Now!




regarding pdf2text

 
Reply to this topicStart new topic

regarding pdf2text

nelgo26
23 Oct, 2008 - 11:17 PM
Post #1

New D.I.C Head
*

Joined: 23 Oct, 2008
Posts: 1

i want save pdf content into mysql database.so pls help me how to convert pdf into text file by php coding.then only i can read that text file after that i need to save that text file into db.

User is offlineProfile CardPM
+Quote Post


pemcconnell
RE: Regarding Pdf2text
24 Oct, 2008 - 12:05 AM
Post #2

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 467



Thanked: 49 times
Dream Kudos: 75
My Contributions
I came across this in an ASP.NET project and had to resort to buying ABCpdf - as far as I can remember it only supported ASP.NET, ASP and VB, but I'm sure there are simillar packages for PHP.

Worst case scenario, you could handle the PDF to text in ASP / ASP.NET, store to the database and pull it from PHP.

As far as just using bog standard PHP to get the text from a PDF - I've never heard of it being done sad.gif sorry.
User is offlineProfile CardPM
+Quote Post

zellyman
RE: Regarding Pdf2text
24 Oct, 2008 - 11:01 AM
Post #3

New D.I.C Head
*

Joined: 24 Oct, 2008
Posts: 5



Thanked: 1 times
My Contributions
QUOTE(nelgo26 @ 24 Oct, 2008 - 12:17 AM) *

i want save pdf content into mysql database.so pls help me how to convert pdf into text file by php coding.then only i can read that text file after that i need to save that text file into db.



You could just save the PDF as binary data into the DB, the only thing is anyone trying to access it would have to have Adobe Reader.

Unless you are talkign about using that PDF to populate different tables of that DB based on its content.. well I don't think its possible unless you wanna display it with HTML though google and then parse it from there.
User is offlineProfile CardPM
+Quote Post

AdaHacker
RE: Regarding Pdf2text
24 Oct, 2008 - 01:08 PM
Post #4

D.I.C Regular
***

Joined: 17 Jun, 2008
Posts: 285



Thanked: 51 times
My Contributions
If you really need to convert a PDF to plain text, the easiest way is just shell out to an external command-line utility to do the heavy lifting. For example, if you're running in a Linux environment, you could install pdftotext on the server and just call it from your script and read the output file:
php

$command = "/usr/bin/pdftotext $pdf_file $text_file");
system($command);
$plain_text = file_get_contents($text_file);
Of course, results will vary with the utility you use and the content of your PDF files.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 06:59PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month