porting pres2 to PHP5/PDFLib
| From: | Christian Wenz | Date: | Thu, 19 Aug 2004 11:11:31 +0000 |
| Subject: | porting pres2 to PHP5/PDFLib | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1022@lists.php.net to get a copy of this message | ||
Hi,
I just tried pre2 and its PDF generating features together with PHP5 (and PDFlib 5.0.x that comes with it). Unfortunately, there were some issues:
* pdf_set_font is deprecated, which in this case means: not supported any more, we have to use pdf_findfont and pdf_setfont now
* some methods (e.g. pdf_stringwidth, pdf_open_file, pdf_get_value, pdf_show_boxed) changed in PHP 5 in a way that parameters that were once optional are now mandatody
* Loading images does not work as function like pdf_open_gif are not supported any longer. I added a check with function_exists(), but on the long run, we might try to move to pdf_open_image (which, however, does not support GIF, so a combination of both methods might be viable).
I have not run into problems with this, however would like to enable you to test the patch first before I commit it (maybe beginning of next week or so). The new file display.php can be found at http://www.hauser-wenz.de/playground/pres2/display.phps (don't get tricked by the "phps", it's the plain code, no syntax highlighting), a diff is at http://www.hauser-wenz.de/playground/pres2/display.php.diff.txt . Please let me know what you think.
Regards
Christian
--
http://www.hauser-wenz.de/
http://www.hauser-wenz.de/blog/