note 53568 deleted from ref.pdf by didou
| From: | didou@php.net | Date: | Wed, 24 Jan 2007 07:46:49 +0000 |
| Subject: | note 53568 deleted from ref.pdf by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122111@lists.php.net to get a copy of this message | ||
Note Submitter: jonathan dot beckett at gmail dot com
----
After spending ages writing my own PDF to text extraction routine (well... a couple of hours), I
realised that you have to interpret the entire stream to have a hope of getting all the characters
you really want - so I started digging.
I then discovered that the XPDF project has everything you need to deal with PDFs - Linux and Win32
binaries are available. Most distro's have the RPMs too.
The resultant command is thus;
$result = shell_exec("pdftotext -raw ".$filename." -");
...it works perfectly for content searching purposes.