School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,149 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,876 people online right now. Registration is fast and FREE... Join Now!



regarding pdf2text

regarding pdf2text Rate Topic: -----

#1 nelgo26  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 23-October 08


Dream Kudos: 0

Posted 23 October 2008 - 11:17 PM

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.
Was This Post Helpful? 0
  • +
  • -


#2 pemcconnell  Icon User is offline

  • D.I.C Regular
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 467
  • Joined: 05-August 08


Dream Kudos: 75

Posted 24 October 2008 - 12:05 AM

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 :( sorry.
Was This Post Helpful? 0
  • +
  • -

#3 zellyman  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 24-October 08


Dream Kudos: 0

Posted 24 October 2008 - 11:01 AM

View Postnelgo26, on 24 Oct, 2008 - 12:17 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#4 AdaHacker  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 466
  • Joined: 17-June 08


Dream Kudos: 0

Posted 24 October 2008 - 01:08 PM

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:
$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.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

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

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month