CVS update: php3/functions

From: Date: Fri, 21 May 1999 11:07:51 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5840@lists.php.net to get a copy of this message
Date: Friday May 21, 1999 @ 7:07 Author: steinm Update of /repository/php3/functions In directory php:/tmp/cvs-serv9449/functions Modified Files: cpdf.c php3_cpdf.h Log Message: - more functions, bugfixes Index: php3/functions/cpdf.c diff -u php3/functions/cpdf.c:1.2 php3/functions/cpdf.c:1.3 --- php3/functions/cpdf.c:1.2 Fri May 21 04:14:06 1999 +++ php3/functions/cpdf.c Fri May 21 07:07:51 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cpdf.c,v 1.2 1999/05/21 08:14:06 steinm Exp $ */ +/* $Id: cpdf.c,v 1.3 1999/05/21 11:07:51 steinm Exp $ */ /* cpdflib.h -- C language API definitions for ClibPDF library * Copyright (C) 1998 FastIO Systems, All Rights Reserved. */ @@ -84,9 +84,11 @@ {"cpdf_close", php3_cpdf_close, NULL}, {"cpdf_page_init", php3_cpdf_page_init, NULL}, {"cpdf_begin_text", php3_cpdf_begin_text, NULL}, - {"cpdf_end_text", php3_cpdf_end_text, NULL}, + {"cpdf_end_text", php3_cpdf_end_text, NULL}, {"cpdf_show", php3_cpdf_show, NULL}, {"cpdf_show_xy", php3_cpdf_show_xy, NULL}, + {"cpdf_text", php3_cpdf_text, NULL}, + {"cpdf_continue_text", php3_cpdf_continue_text, NULL}, {"cpdf_set_font", php3_cpdf_set_font, NULL}, {"cpdf_set_leading", php3_cpdf_set_leading, NULL}, {"cpdf_set_text_rendering", php3_cpdf_set_text_rendering,NULL}, @@ -373,8 +375,6 @@ } sprintf(buffer, "0 0 %d %d", width, height); -fprintf(stderr, "%s\n", buffer); -// cpdf_pageInit(pagenr, PORTRAIT, LETTER, LETTER); cpdf_pageInit(pagenr, orientation, buffer, buffer); RETURN_TRUE; @@ -484,6 +484,114 @@ } cpdf_rawText((float) arg3->value.dval, (float) arg4->value.dval, 0.0, arg2->value.str.val); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void cpdf_continue_text(int pdfdoc, string text) + Output text in next line */ +void php3_cpdf_continue_text(INTERNAL_FUNCTION_PARAMETERS) { + pval *arg1, *arg2; + int id, type; + int *pdf; + CPDF_TLS_VARS; + + if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + convert_to_string(arg2); + id=arg1->value.lval; + pdf = php3_list_find(id,&type); + if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + cpdf_textCRLFshow(arg2->value.str.val); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void cpdf_text(int pdfdoc, string text[, double x-koor, double y-koor[, double orientation, [int alignmode]]]) + Output text */ +void php3_cpdf_text(INTERNAL_FUNCTION_PARAMETERS) { + pval *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; + int id, type, argc; + int *pdf; + CPDF_TLS_VARS; + + argc = ARG_COUNT(ht); + switch(argc) { + case 2: + if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) { + WRONG_PARAM_COUNT; + } + break; + case 4: + if (getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { + WRONG_PARAM_COUNT; + } + break; + case 5: + if (getParameters(ht, 5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { + WRONG_PARAM_COUNT; + } + break; + case 6: + if (getParameters(ht, 6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { + WRONG_PARAM_COUNT; + } + break; + default: + WRONG_PARAM_COUNT; + } + + convert_to_long(arg1); + convert_to_string(arg2); + id=arg1->value.lval; + pdf = php3_list_find(id,&type); + if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { + php3_error(E_WARNING,"Unable to find file identifier %d",id); + RETURN_FALSE; + } + + switch(argc) { + case 2: + cpdf_textShow(arg2->value.str.val); + break; + case 4: + convert_to_double(arg3); + convert_to_double(arg4); + cpdf_rawText((float) arg3->value.dval, + (float) arg4->value.dval, + 0.0, + arg2->value.str.val); + break; + case 5: + convert_to_double(arg3); + convert_to_double(arg4); + convert_to_double(arg5); + cpdf_rawText((float) arg3->value.dval, + (float) arg4->value.dval, + (float) arg5->value.dval, + arg2->value.str.val); + break; + case 6: + convert_to_double(arg3); + convert_to_double(arg4); + convert_to_double(arg5); + convert_to_double(arg6); + cpdf_rawTextAligned((float) arg3->value.dval, + (float) arg4->value.dval, + (float) arg5->value.dval, + (float) arg6->value.dval, + arg2->value.str.val); + break; + } RETURN_TRUE; } Index: php3/functions/php3_cpdf.h diff -u php3/functions/php3_cpdf.h:1.2 php3/functions/php3_cpdf.h:1.3 --- php3/functions/php3_cpdf.h:1.2 Fri May 21 04:14:06 1999 +++ php3/functions/php3_cpdf.h Fri May 21 07:07:51 1999 @@ -26,7 +26,7 @@ | Authors: Uwe Steinmann | +----------------------------------------------------------------------+ */ -/* $Id: php3_cpdf.h,v 1.2 1999/05/21 08:14:06 steinm Exp $ */ +/* $Id: php3_cpdf.h,v 1.3 1999/05/21 11:07:51 steinm Exp $ */ #ifndef _PHP3_CPDF_H #define _PHP3_CPDF_H @@ -52,6 +52,8 @@ extern void php3_cpdf_end_text(INTERNAL_FUNCTION_PARAMETERS); extern void php3_cpdf_show(INTERNAL_FUNCTION_PARAMETERS); extern void php3_cpdf_show_xy(INTERNAL_FUNCTION_PARAMETERS); +extern void php3_cpdf_continue_text(INTERNAL_FUNCTION_PARAMETERS); +extern void php3_cpdf_text(INTERNAL_FUNCTION_PARAMETERS); extern void php3_cpdf_set_font(INTERNAL_FUNCTION_PARAMETERS); extern void php3_cpdf_set_leading(INTERNAL_FUNCTION_PARAMETERS); extern void php3_cpdf_set_text_rendering(INTERNAL_FUNCTION_PARAMETERS); -- 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 (#5840) next »