Re: reading a PDF's title
| From: | Koala) | Date: | Wed, 20 Sep 2006 16:08:30 +0000 |
| Subject: | Re: reading a PDF's title | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241982@lists.php.net to get a copy of this message | ||
Hello all,
I worked it out. I actually vi several acrobat file
to see the actual code inside.
This is my script after my study.
This is certainly not the best method, but
it works for me. Somebody may be interested
it using or improve this. Please tell me if you
guys got a better method:
<?php
$string = file_get_contents($filename);
$start = strpos($string, "<dc:title>") + 10;
$length = strpos(substr($string, $start), '</dc:title>');
if ($length) {
$title = strip_tags(substr($string, $start, $length));
}
?>
Cheers,
Koala
On 9/8/06, Shu Hung (Koala) <koalay@gmail.com> wrote:
Hello, I know PDF files stores a "Title" somewhere. I'm not sure if it is at meta data or elsewhere. Does anyone have any method to get this "Title" out? Thanks Koala Yeung