CVS update: php3/functions

From: Date: Sun, 28 Feb 1999 23:03:51 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4381@lists.php.net to get a copy of this message
Date: Sunday February 28, 1999 @ 18:03 Author: steffann Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv15013/functions Modified Files: pdf.c php3_pdf.h Log Message: Added PDF_put_image and PDF_execute_image functions Added docs for PDF_put_image and PDF_execute_image Index: php3/functions/pdf.c diff -c php3/functions/pdf.c:1.24 php3/functions/pdf.c:1.25 *** php3/functions/pdf.c:1.24 Wed Feb 10 05:47:16 1999 --- php3/functions/pdf.c Sun Feb 28 18:03:51 1999 *************** *** 27,33 **** +----------------------------------------------------------------------+ */ ! /* $Id: pdf.c,v 1.24 1999/02/10 10:47:16 steinm Exp $ */ /* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997 Thomas Merz. */ --- 27,33 ---- +----------------------------------------------------------------------+ */ ! /* $Id: pdf.c,v 1.25 1999/02/28 23:03:51 steffann Exp $ */ /* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997 Thomas Merz. */ *************** *** 141,146 **** --- 141,148 ---- {"pdf_open_gif", php3_pdf_open_gif, NULL}, {"pdf_close_image", php3_pdf_close_image, NULL}, {"pdf_place_image", php3_pdf_place_image, NULL}, + {"pdf_put_image", php3_pdf_put_image, NULL}, + {"pdf_execute_image", php3_pdf_execute_image, NULL}, {NULL, NULL, NULL} }; *************** *** 1820,1826 **** } /* }}} */ ! /* {{{ proto int pdf_open_gif(void) Returns an image for placement in a pdf document */ void php3_pdf_open_gif(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2; --- 1822,1828 ---- } /* }}} */ ! /* {{{ proto int pdf_open_gif(int pdf, string giffile) Returns an image for placement in a pdf document */ void php3_pdf_open_gif(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2; *************** *** 1854,1860 **** } /* }}} */ ! /* {{{ proto int pdf_open_jpeg(void) Returns an image for placement in a pdf document */ void php3_pdf_open_jpeg(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2; --- 1856,1862 ---- } /* }}} */ ! /* {{{ proto int pdf_open_jpeg(int pdf, string jpegfile) Returns an image for placement in a pdf document */ void php3_pdf_open_jpeg(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2; *************** *** 1915,1921 **** } /* }}} */ ! /* {{{ proto void pdf_place_image(int pdfimage) Places image in the pdf document */ void php3_pdf_place_image(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2, *arg3, *arg4, *arg5; --- 1917,1923 ---- } /* }}} */ ! /* {{{ proto void pdf_place_image(int pdf, int pdfimage, int x, int y, int scale) Places image in the pdf document */ void php3_pdf_place_image(INTERNAL_FUNCTION_PARAMETERS) { pval *arg1, *arg2, *arg3, *arg4, *arg5; *************** *** 1949,1954 **** --- 1951,2030 ---- convert_to_double(arg5); PDF_place_image(pdf, pdf_image, (float) arg3->value.dval, (float) arg4->value.dval, arg5->value.dval); + + RETURN_TRUE; + } + /* }}} */ + + /* {{{ proto void pdf_put_image(int pdf, int pdfimage) + Stores image in the pdf document for later use */ + void php3_pdf_put_image(INTERNAL_FUNCTION_PARAMETERS) { + pval *arg1, *arg2; + int id, type; + PDF_image *pdf_image; + PDF *pdf; + PDF_TLS_VARS; + + if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + id=arg1->value.lval; + pdf = php3_list_find(id,&type); + if(!pdf || type!=PDF_GLOBAL(le_pdf)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + convert_to_long(arg2); + id=arg2->value.lval; + pdf_image = php3_list_find(id,&type); + if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + PDF_put_image(pdf, pdf_image); + + RETURN_TRUE; + } + /* }}} */ + + /* {{{ proto void pdf_execute_image(int pdf, int pdfimage, int x, int y, int scale) + Places stored image in the pdf document */ + void php3_pdf_execute_image(INTERNAL_FUNCTION_PARAMETERS) { + pval *arg1, *arg2, *arg3, *arg4, *arg5; + int id, type; + PDF_image *pdf_image; + PDF *pdf; + PDF_TLS_VARS; + + if (ARG_COUNT(ht) != 5 || getParameters(ht, 5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + id=arg1->value.lval; + pdf = php3_list_find(id,&type); + if(!pdf || type!=PDF_GLOBAL(le_pdf)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + convert_to_long(arg2); + id=arg2->value.lval; + pdf_image = php3_list_find(id,&type); + if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + convert_to_double(arg3); + convert_to_double(arg4); + convert_to_double(arg5); + + PDF_execute_image(pdf, pdf_image, (float) arg3->value.dval, (float) arg4->value.dval, arg5->value.dval); RETURN_TRUE; } Index: php3/functions/php3_pdf.h diff -c php3/functions/php3_pdf.h:1.7 php3/functions/php3_pdf.h:1.8 *** php3/functions/php3_pdf.h:1.7 Fri Jan 8 08:42:03 1999 --- php3/functions/php3_pdf.h Sun Feb 28 18:03:51 1999 *************** *** 26,32 **** | Authors: Uwe Steinmann | +----------------------------------------------------------------------+ */ ! /* $Id: php3_pdf.h,v 1.7 1999/01/08 13:42:03 steinm Exp $ */ #ifndef _PHP3_PDF_H #define _PHP3_PDF_H --- 26,32 ---- | Authors: Uwe Steinmann | +----------------------------------------------------------------------+ */ ! /* $Id: php3_pdf.h,v 1.8 1999/02/28 23:03:51 steffann Exp $ */ #ifndef _PHP3_PDF_H #define _PHP3_PDF_H *************** *** 104,109 **** --- 104,111 ---- extern void php3_pdf_open_gif(INTERNAL_FUNCTION_PARAMETERS); extern void php3_pdf_close_image(INTERNAL_FUNCTION_PARAMETERS); extern void php3_pdf_place_image(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_pdf_put_image(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_pdf_execute_image(INTERNAL_FUNCTION_PARAMETERS); #else #define pdf_module_ptr NULL #endif -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4381) next »