Reply to Re: PHP Read PDF

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация