Re: PDF pain
| From: | Richard Lynch | Date: | Sat, 20 Jul 2002 06:29:29 +0000 |
| Subject: | Re: PDF pain | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108630@lists.php.net to get a copy of this message | ||
>
>Thanks for all the suggestions. I am making progress after discovering a
>typo in my code (single quotes in a header() string containing a $var ...
>double quotes fixed it).
>
>Now I get a pdf document but no text :-(
>
>If I save the doc to disk and try to open it with xpdf, it complains that
>the "xref table" is broken and that it can't find a "trailer
>dictionary".
Even though you fixed one bug, make sure the header calls are at the end of
your PHP script...
Any other bugs lurking will show up in the browser before the Content-type,
and you'll actually see them.
I'd also make sure all my PDF/PHP code as doing as much error-checking as
possible.
Check all return values to be sure they are valid.
I don't know what an xref table or trailer dictionary are, but if those are
standard PDF elements, and your PHP code is trying to create them, I'd sure
zero in on that section of code first, as well as the section immediately
preceding it, which might be polluting the PDF stream of data with a PHP
error message.
Open up that PDF file in a text editor, and search for "Error" in it.
--
Like Music? http://l-i-e.com/artists.htm