]> granicus.if.org Git - php/commitdiff
- added cpdf_global_set_document_limits()
authorUwe Steinmann <steinm@php.net>
Mon, 10 Jan 2000 11:01:56 +0000 (11:01 +0000)
committerUwe Steinmann <steinm@php.net>
Mon, 10 Jan 2000 11:01:56 +0000 (11:01 +0000)
ext/cpdf/cpdf.c
ext/cpdf/php_cpdf.h

index 72b62b2f2a1382e2c12b82a5b87fdcae669a41c3..c334503208884e3268f6b7271ce0389a117d6798 100644 (file)
@@ -76,6 +76,7 @@ static int le_outline;
 #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 @@ PHP_MSHUTDOWN_FUNCTION(cpdf){
        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 @@ PHP_FUNCTION(cpdf_set_viewer_preferences) {
    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 @@ PHP_FUNCTION(cpdf_setflat) {
        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 @@ PHP_FUNCTION(cpdf_setdash) {
                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 @@ PHP_FUNCTION(cpdf_finalize) {
    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 @@ PHP_FUNCTION(cpdf_place_inline_image) {
        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 90f408703444887f3a5c7b23f750ea9e5937d237..8c3dde47550fc6c035f94a9dbfc9e2f8391f41dc 100644 (file)
@@ -42,6 +42,7 @@ extern PHP_MINFO_FUNCTION(cpdf);
 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);