|
Posted by gosha bine on 09/20/07 10:40
On 19.09.2007 22:41 Shelly wrote:
>> "Good Man" <heyho@letsgo.com> wrote in message
>>> ... also found a link that suggests PDF files are just gzipped XML, so
>>> maybe you could write your own extractor:
>>>
>>> http://www.thescripts.com/forum/thread631837.html
>> hmm.
>
> I tried a very simple test with a very small PDF file. The code is:
>
> <?php
> $pdfFile = "./images/Postcard.pdf";
> echo $pdfFile . "<br>";
> $fp = gzopen($pdfFile, "r");
> $rawStream = gzread($fp, 5000000);
> gzclose($fp);
> echo "**" .$rawStream . "**<br>";
> $stream = gzuncompress($rawStream);
> echo $stream;
> ?>
>
>
> It came up with a "data error" in the line with
> $stream = gzuncompress($rawStream);
> The error was in the gzuncompress.
>
>
Some parts of PDF are compressed using zip algorithm, but PDF itself is
not a ZIP file. You cannot read it with gz functions.
--
gosha bine
makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
Navigation:
[Reply to this message]
|