]> granicus.if.org Git - php/commitdiff
- More function in php module
authorUwe Steinmann <steinm@php.net>
Sat, 26 Feb 2000 11:58:49 +0000 (11:58 +0000)
committerUwe Steinmann <steinm@php.net>
Sat, 26 Feb 2000 11:58:49 +0000 (11:58 +0000)
NEWS
ext/pdf/pdf.c
ext/pdf/php_pdf.h

diff --git a/NEWS b/NEWS
index a03c2b55d1b1d3676be48e9f5b8194ce7bbfbd80..296bc1e4e49e42d783a36e334c20f27b2ed4c953 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ???, 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 692ab91a79349b2204c0bf6f379009e46b78dd46..835bccd6e72217a9efa8b44242a59aa71af146be 100644 (file)
@@ -93,6 +93,10 @@ function_entry pdf_functions[] = {
        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 @@ function_entry pdf_functions[] = {
        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 @@ static void pdf_efree(PDF *p, void *mem) {
 }
 #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 @@ PHP_FUNCTION(pdf_show_xy) {
 }
 /* }}} */
 
+/* {{{ 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 @@ PHP_FUNCTION(pdf_rotate) {
 }
 /* }}} */
 
+/* {{{ 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) {
@@ -1775,6 +1844,34 @@ PHP_FUNCTION(pdf_clip) {
 }
 /* }}} */
 
+/* {{{ 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;
+}
+/* }}} */
+
 /* {{{ proto void pdf_setgray_fill(int pdfdoc, double value)
    Sets filling color to gray value */
 PHP_FUNCTION(pdf_setgray_fill) {
index e707507eb83e30c9ec66ca6b1f5170ca96fc0db9..c0840f2f549cb7d5f44c6d11de6bc0c2e05341b8 100644 (file)
@@ -58,6 +58,10 @@ PHP_FUNCTION(pdf_begin_page);
 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_fill_stroke);
 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);