cvs: /php4 NEWS /php4/ext/pdf pdf.c php_pdf.h

From: Date: Sat, 26 Feb 2000 11:59:18 +0000
Subject: cvs: /php4 NEWS /php4/ext/pdf pdf.c php_pdf.h
Groups: php.version4 
Request: Send a blank email to php-version4+get-11033@lists.php.net to get a copy of this message
steinm Sat Feb 26 03:59:18 2000 EDT Modified files: /php4 NEWS /php4/ext/pdf pdf.c php_pdf.h Log: - More function in php module Index: php4/NEWS diff -u php4/NEWS:1.150 php4/NEWS:1.151 --- php4/NEWS:1.150 Sat Feb 26 02:36:06 2000 +++ php4/NEWS Sat Feb 26 03:58:48 2000 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ???, Version 4.0 Beta 5 +- Add pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe) - Fixed comparison of (string) "inf" with (string) "inf", which was erroneously returning false (Zeev) - Implemented default_charset and default_mimetype config directives (Stig) Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.26 php4/ext/pdf/pdf.c:1.27 --- php4/ext/pdf/pdf.c:1.26 Wed Feb 23 08:57:08 2000 +++ php4/ext/pdf/pdf.c Sat Feb 26 03:58:48 2000 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdf.c,v 1.26 2000/02/23 16:57:08 eschmid Exp $ */ +/* $Id: pdf.c,v 1.27 2000/02/26 11:58:48 steinm Exp $ */ /* pdflib 2.01 is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997 Thomas Merz. */ @@ -93,6 +93,10 @@ PHP_FE(pdf_end_page, NULL) PHP_FE(pdf_show, NULL) PHP_FE(pdf_show_xy, NULL) +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 20) + PHP_FE(pdf_show_boxed, NULL) + PHP_FE(pdf_skew, NULL) +#endif PHP_FE(pdf_set_font, NULL) PHP_FE(pdf_set_leading, NULL) PHP_FE(pdf_set_text_rendering, NULL) @@ -134,6 +138,7 @@ PHP_FE(pdf_closepath_fill_stroke, NULL) PHP_FE(pdf_endpath, NULL) PHP_FE(pdf_clip, NULL) + PHP_FE(pdf_set_parameter, NULL) PHP_FE(pdf_setgray_fill, NULL) PHP_FE(pdf_setgray_stroke, NULL) PHP_FE(pdf_setgray, NULL) @@ -223,7 +228,7 @@ } #endif -#if PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10 +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10) static size_t pdf_flushwrite(PDF *p, void *data, size_t size){ if(php_header()) return(php_write(data, size)); @@ -602,6 +607,40 @@ } /* }}} */ +/* {{{ proto void pdf_show_boxed(int pdfdoc, string text, double x-koor, double y-koor, double width, double height, string mode) + Output text formated in a boxed */ +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 20) +PHP_FUNCTION(pdf_show_boxed) { + pval *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7; + int id, type; + PDF *pdf; + PDF_TLS_VARS; + + if (ARG_COUNT(ht) != 7 || getParameters(ht, 7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + convert_to_string(arg2); + convert_to_double(arg3); + convert_to_double(arg4); + convert_to_double(arg5); + convert_to_double(arg6); + id=arg1->value.lval; + pdf = zend_list_find(id,&type); + if(!pdf || type!=PDF_GLOBAL(le_pdf)) { + php_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + PDF_show_boxed(pdf, arg2->value.str.val, (float) arg3->value.dval, (float) arg4->value.dval, (float) arg5->value.dval, (float) arg6->value.dval, arg7->value.str.val, NULL); + + RETURN_TRUE; +} +#endif +/* }}} */ + + /* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, string encoding [, int embed]) Select the current font face, size and encoding */ PHP_FUNCTION(pdf_set_font) { @@ -1198,6 +1237,36 @@ } /* }}} */ +/* {{{ proto void pdf_skew(int pdfdoc, double xangle, double yangle) + Skew the coordinate system */ +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 20) +PHP_FUNCTION(pdf_skew) { + pval *arg1, *arg2, *arg3; + int id, type; + PDF *pdf; + PDF_TLS_VARS; + + if (ARG_COUNT(ht) != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + convert_to_double(arg2); + convert_to_double(arg3); + id=arg1->value.lval; + pdf = zend_list_find(id,&type); + if(!pdf || type!=PDF_GLOBAL(le_pdf)) { + php_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + PDF_skew(pdf, (float) arg2->value.dval, (float) arg3->value.dval); + + RETURN_TRUE; +} +#endif +/* }}} */ + /* {{{ proto void pdf_setflat(int pdfdoc, double value) Sets flatness */ PHP_FUNCTION(pdf_setflat) { @@ -1770,6 +1839,34 @@ } PDF_clip(pdf); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void pdf_set_parameter(int pdfdoc, string parameter, string value) + Sets arbitrary parameters */ +PHP_FUNCTION(pdf_set_parameter) { + pval *arg1, *arg2, *arg3; + int id, type; + PDF *pdf; + PDF_TLS_VARS; + + if (ARG_COUNT(ht) != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + convert_to_string(arg2); + convert_to_string(arg3); + id=arg1->value.lval; + pdf = zend_list_find(id,&type); + if(!pdf || type!=PDF_GLOBAL(le_pdf)) { + php_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + PDF_set_parameter(pdf, arg2->value.str.val, arg3->value.str.val); RETURN_TRUE; } Index: php4/ext/pdf/php_pdf.h diff -u php4/ext/pdf/php_pdf.h:1.5 php4/ext/pdf/php_pdf.h:1.6 --- php4/ext/pdf/php_pdf.h:1.5 Mon Feb 21 08:23:07 2000 +++ php4/ext/pdf/php_pdf.h Sat Feb 26 03:58:48 2000 @@ -26,7 +26,7 @@ | Authors: Uwe Steinmann | +----------------------------------------------------------------------+ */ -/* $Id: php_pdf.h,v 1.5 2000/02/21 16:23:07 steinm Exp $ */ +/* $Id: php_pdf.h,v 1.6 2000/02/26 11:58:48 steinm Exp $ */ #ifndef _PHP_PDF_H #define _PHP_PDF_H @@ -58,6 +58,10 @@ PHP_FUNCTION(pdf_end_page); PHP_FUNCTION(pdf_show); PHP_FUNCTION(pdf_show_xy); +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 20) +PHP_FUNCTION(pdf_show_boxed); +PHP_FUNCTION(pdf_skew); +#endif PHP_FUNCTION(pdf_set_font); PHP_FUNCTION(pdf_get_font); PHP_FUNCTION(pdf_get_fontname); @@ -99,6 +103,7 @@ PHP_FUNCTION(pdf_closepath_fill_stroke); PHP_FUNCTION(pdf_endpath); PHP_FUNCTION(pdf_clip); +PHP_FUNCTION(pdf_set_parameter); PHP_FUNCTION(pdf_setgray_fill); PHP_FUNCTION(pdf_setgray_stroke); PHP_FUNCTION(pdf_setgray);

« previous php.version4 (#11033) next »