note 10780 rejected from function.cpdf-import-jpeg by didou
| From: | didou@php.net | Date: | Fri, 15 Aug 2003 13:46:32 +0000 |
| Subject: | note 10780 rejected from function.cpdf-import-jpeg by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54195@lists.php.net to get a copy of this message | ||
Note Submitter: mhagerty@voyager.net
----
Actually you should *never* call cpdf_restore() without calling cpdf_save() first! The reason this
function does not work is because:
1. It is coded incorrectly, like many of the cpdf functions. I am constatnly making personal
patches to the interface. The biggest flaw in many of the functions is that they completely ignore
the [mode] parameter. Either the interface looks at the wrong passed parameter [cpdf_text() for
example] or the documented parameters are wrong (line this function.)
2. The documented functions are wrong. The function actually has a parameter inbetween the
[y-scale] and the [mode]. The missing parameter is called [g-save] and should *always* be set to 1.
What it means is to save the graphics state before placing the image and restore it after placing
the image (see ClibPDF documentation.)
3. In the ClibPDF package you can actually use this function to get the size of your image! The
[x-size], [y-size], [x-scale], and [y-scale] are all *supposed* to be passed by reference so the
function can modify them to the correct values (see ClibPDF manual.) So, that is what I will be
doing tonight, modifying this funciton to work correctly.
To use this library it is *required* that you have the ClibPDF documentation and read it. I
don't understand why the maintainer of this port decided to obsceure much of the ClibPDF
functionality, but they did. Also, *many* of the ClibPDF functions are not available via this port,
so you may have to write your own access functions (as I have had to.)
Hope this helps.
Matthew