PDFlib bug ?
| From: | David Bouw | Date: | Thu, 23 Nov 2000 10:47:14 +0000 |
| Subject: | PDFlib bug ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26814@lists.php.net to get a copy of this message | ||
Hi, I using PDFlib 3.01 with PHP 4.02...
This works great, but I think there is a small bug/problem in PDFlib..
I generate some PDF's with the above combination.
Reading these files in Adobe Reader works fine..
The problem comes with Ghostscript, on some PDF's this program gives errors..
With the help with a developer of Ghostscript I found that if you view the PDF file with a text
editor you can see that the end of the file is mangled:
Eg end of file:
<</Size 9
/Info 3 0 R
/Root 2 0 R
>>
startxref
1983
%%EOF
--here you see mangled data ----
--here you see mangled data ----
I don't always get this problem.
Now I found the following on www.php.net describing PDFlib
There seems to be a [known] bug in
pdflib-3.0.1 where file descriptors
are overwritten, resulting in an
apache segfault when accessing pdf
functions. The bug is documented in
the changelog of pdflib-3.0.2,
which cures this problem. (Thanks to
Jani for catching this.)
I also found a problem where fclose is also called by the PDF function. (In stead of only once by
the fclose function)
Before I go searching for all these files/patches. Has someone else had the above problem, and is it
related to the fclose bug found in PDFlib.. ??
I also get an idea that I get this problem when using the PDF_rotate functions and then using the
PDF_set_font function...
Failures are very random, and sometimes by chaning the order in which PDF functions are called which
place texts and set fonts I can get good or bad results..
Any suggestions from people who have seen this error is greatly appreciated..
Bye Bye
David Bouw