cvs: /php4/ext/cpdf cpdf.c php_cpdf.h
| From: | Uwe Steinmann | Date: | Mon, 10 Jan 2000 11:02:26 +0000 |
| Subject: | cvs: /php4/ext/cpdf cpdf.c php_cpdf.h | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9003@lists.php.net to get a copy of this message | ||
steinm Mon Jan 10 03:02:26 2000 EDT
Modified files:
/php4/ext/cpdf cpdf.c php_cpdf.h
Log:
- added cpdf_global_set_document_limits()
Index: php4/ext/cpdf/cpdf.c
diff -u php4/ext/cpdf/cpdf.c:1.7 php4/ext/cpdf/cpdf.c:1.8
--- php4/ext/cpdf/cpdf.c:1.7 Tue Dec 21 12:02:25 1999
+++ php4/ext/cpdf/cpdf.c Mon Jan 10 03:01:56 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cpdf.c,v 1.7 1999/12/21 20:02:25 andrei Exp $ */
+/* $Id: cpdf.c,v 1.8 2000/01/10 11:01:56 steinm Exp $ */
/* cpdflib.h -- C language API definitions for ClibPDF library
* Copyright (C) 1998 FastIO Systems, All Rights Reserved.
*/
@@ -76,6 +76,7 @@
#endif
function_entry cpdf_functions[] = {
+ PHP_FE(cpdf_global_set_documents_settings, NULL)
PHP_FE(cpdf_set_creator, NULL)
PHP_FE(cpdf_set_title, NULL)
PHP_FE(cpdf_set_subject, NULL)
@@ -190,6 +191,31 @@
return SUCCESS;
}
+/* {{{ proto void cpdf_global_set_document_settings(int maxPages, int maxFonts, int maxImages, int
maxAnnots, int maxObjects)
+ Sets document settings for all documents */
+PHP_FUNCTION(cpdf_global_set_documents_settings) {
+ pval *argv[5];
+ int argc;
+ CPDF_TLS_VARS;
+
+ argc = ARG_COUNT(ht);
+ if(argc != 5)
+ WRONG_PARAM_COUNT;
+ if (getParametersArray(ht, argc, argv) == FAILURE)
+ WRONG_PARAM_COUNT;
+
+ convert_to_long(argv[0]);
+ convert_to_long(argv[1]);
+ convert_to_long(argv[2]);
+ convert_to_long(argv[3]);
+ convert_to_long(argv[4]);
+
+ cpdf_setGlobalDocumentLimits(argv[0]->value.lval, argv[1]->value.lval,
argv[2]->value.lval, argv[3]->value.lval, argv[4]->value.lval);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
/* {{{ proto bool cpdf_set_creator(int pdfdoc, string creator)
Sets the creator field */
PHP_FUNCTION(cpdf_set_creator) {
@@ -337,8 +363,7 @@
Opens a new pdf document */
PHP_FUNCTION(cpdf_open) {
pval *arg1, *arg2, *arg3;
- int id, type, argc;
- FILE *fp;
+ int id, argc;
CPDFdoc *cpdf;
CPDF_TLS_VARS;
@@ -1230,7 +1255,6 @@
pval *arg1, *arg2;
int id, type;
CPDFdoc *pdf;
- int flatness;
CPDF_TLS_VARS;
if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
@@ -1404,7 +1428,7 @@
RETURN_FALSE;
}
- snprintf(buffer, BUFFERLEN, "[%d %d] 0", arg2->value.lval, arg3->value.lval);
+ snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) arg2->value.lval, (int)
arg3->value.lval);
cpdf_setdash(pdf, buffer);
RETURN_TRUE;
@@ -2176,7 +2200,6 @@
Returns the internal memory stream as string */
PHP_FUNCTION(cpdf_output_buffer) {
pval *arg1;
- pval out_arr;
int id, type, lenght;
CPDFdoc *pdf;
char *buffer;
@@ -2308,7 +2331,6 @@
pval *argv[11];
int id, gid, type, argc, mode=0;
int count, i, j, color;
- float width, height;
CPDFdoc *pdf;
unsigned char *buffer, *ptr;
gdImagePtr im;
Index: php4/ext/cpdf/php_cpdf.h
diff -u php4/ext/cpdf/php_cpdf.h:1.2 php4/ext/cpdf/php_cpdf.h:1.3
--- php4/ext/cpdf/php_cpdf.h:1.2 Fri Dec 17 12:54:47 1999
+++ php4/ext/cpdf/php_cpdf.h Mon Jan 10 03:01:56 2000
@@ -26,7 +26,7 @@
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
-/* $Id: php_cpdf.h,v 1.2 1999/12/17 20:54:47 zeev Exp $ */
+/* $Id: php_cpdf.h,v 1.3 2000/01/10 11:01:56 steinm Exp $ */
#ifndef _PHP_CPDF_H
#define _PHP_CPDF_H
@@ -42,6 +42,7 @@
extern PHP_MINIT_FUNCTION(cpdf);
extern PHP_RINIT_FUNCTION(cpdf);
extern PHP_MSHUTDOWN_FUNCTION(cpdf);
+PHP_FUNCTION(cpdf_global_set_documents_settings);
PHP_FUNCTION(cpdf_set_creator);
PHP_FUNCTION(cpdf_set_title);
PHP_FUNCTION(cpdf_set_subject);