[PHP-CVS] cvs: php4 /ext/pdf pdf.c

2001-02-21 Thread Rainer Schaaf

rjs Wed Feb 21 15:30:20 2001 EDT

  Modified files:  
/php4/ext/pdf   pdf.c 
  Log:
  When using pdf_get_buffer() and doing a correct cleanup by calling pdf_delete()
  this always resulted in a coredump (after everything was finished, so only
  visible in the logfile).
  So it seems to be neccesary to copy the contents of the result of get_buffer,
  to avoid this coredump.
  
  
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.71 php4/ext/pdf/pdf.c:1.72
--- php4/ext/pdf/pdf.c:1.71 Thu Feb 15 06:48:57 2001
+++ php4/ext/pdf/pdf.c  Wed Feb 21 15:30:20 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.71 2001/02/15 14:48:57 thies Exp $ */
+/* $Id: pdf.c,v 1.72 2001/02/21 23:30:20 rjs Exp $ */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -264,7 +264,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "PDF Support", "enabled" );
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
-   php_info_print_table_row(2, "Revision", "$Revision: 1.71 $" );
+   php_info_print_table_row(2, "Revision", "$Revision: 1.72 $" );
php_info_print_table_end();
 
 }
@@ -2176,7 +2176,7 @@
 
buffer = PDF_get_buffer(pdf, &size);
 
-   RETURN_STRINGL((char *)buffer, size, 0);
+   RETURN_STRINGL((char *)buffer, size, 1);
 }
 
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pdf pdf.c php_pdf.h

2001-03-01 Thread Rainer Schaaf

rjs Thu Mar  1 11:51:54 2001 EDT

  Modified files:  
/php4/ext/pdf   pdf.c php_pdf.h 
  Log:
  - integrated new functions vor PDFlib V4.0 (beta1)
  - all functions accepting strings now support binary strings, by calling
the appropriate PDF*2() functions.
  
  

Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.73 php4/ext/pdf/pdf.c:1.74
--- php4/ext/pdf/pdf.c:1.73 Sun Feb 25 22:07:11 2001
+++ php4/ext/pdf/pdf.c  Thu Mar  1 11:51:53 2001
@@ -17,7 +17,8 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.73 2001/02/26 06:07:11 andi Exp $ */
+/* $Id: pdf.c,v 1.74 2001/03/01 19:51:53 rjs Exp $ */
+/* Id: pdf.c,v 1.73 2001/02/26 06:07:11 andi Exp  */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -57,6 +58,9 @@
  */
 #define PDFLIB_IMAGE_OFFSET1
 #define PDFLIB_FONT_OFFSET 1
+#define PDFLIB_PDI_OFFSET  1
+#define PDFLIB_PATTERN_OFFSET  1
+#define PDFLIB_SPOT_OFFSET 1
 
 function_entry pdf_functions[] = {
/* sorry for sorting this stuff like the pdflib manual,
@@ -109,12 +113,6 @@
PHP_FE(pdf_closepath_fill_stroke, NULL)
PHP_FE(pdf_clip, NULL)
PHP_FE(pdf_endpath, NULL)
-   PHP_FE(pdf_setgray_fill, NULL)
-   PHP_FE(pdf_setgray_stroke, NULL)
-   PHP_FE(pdf_setgray, NULL)
-   PHP_FE(pdf_setrgbcolor_fill, NULL)
-   PHP_FE(pdf_setrgbcolor_stroke, NULL)
-   PHP_FE(pdf_setrgbcolor, NULL)
PHP_FE(pdf_open_image_file, NULL)  /* new parameters: [char *stringpram, int 
intparam] */
PHP_FE(pdf_open_ccitt, NULL)/* new function */
PHP_FE(pdf_open_image, NULL)/* new function */
@@ -174,6 +172,33 @@
 #if HAVE_LIBGD13
PHP_FE(pdf_open_memory_image, NULL)
 #endif
+   /* depreciatet after V4.0 of PDFlib */
+   PHP_FE(pdf_setgray_fill, NULL)
+   PHP_FE(pdf_setgray_stroke, NULL)
+   PHP_FE(pdf_setgray, NULL)
+   PHP_FE(pdf_setrgbcolor_fill, NULL)
+   PHP_FE(pdf_setrgbcolor_stroke, NULL)
+   PHP_FE(pdf_setrgbcolor, NULL)
+
+#if (PDFLIB_MAJORVERSION >= 4)
+/* support for new functions in PDFlib V4.0 */
+   PHP_FE(pdf_open_pdi, NULL)
+   PHP_FE(pdf_close_pdi, NULL)
+   PHP_FE(pdf_open_pdi_page, NULL)
+   PHP_FE(pdf_close_pdi_page, NULL)
+   PHP_FE(pdf_get_pdi_parameter, NULL)
+   PHP_FE(pdf_get_pdi_value, NULL)
+   PHP_FE(pdf_begin_pattern, NULL)
+   PHP_FE(pdf_end_pattern, NULL)
+   PHP_FE(pdf_begin_template, NULL)
+   PHP_FE(pdf_end_template, NULL)
+   PHP_FE(pdf_setcolor, NULL)
+   PHP_FE(pdf_makespotcolor, NULL)
+   PHP_FE(pdf_arcn, NULL)
+   PHP_FE(pdf_add_thumbnail, NULL)
+   PHP_FE(pdf_initgraphics, NULL)
+   PHP_FE(pdf_setmatrix, NULL)
+#endif /* PDFlib >= V4 */
 
{NULL, NULL, NULL}
 };
@@ -263,14 +288,22 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "PDF Support", "enabled" );
+#if (PDFLIB_MAJORVERSION >= 4)
+   php_info_print_table_row(2, "PDFlib GmbH Version", PDFLIB_VERSIONSTRING );
+#else
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
-   php_info_print_table_row(2, "Revision", "$Revision: 1.73 $" );
+#endif
+   php_info_print_table_row(2, "Revision", "$Revision: 1.74 $" );
php_info_print_table_end();
 
 }
 
 PHP_MINIT_FUNCTION(pdf)
 {
+   if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) ||
+   (PDF_get_minorversion() != PDFLIB_MINORVERSION)) {
+   php_error(E_ERROR,"PDFlib error: Version mismatch in wrapper code");
+   }
le_pdf = zend_register_list_destructors_ex(_free_pdf_doc, NULL, "pdf object", 
module_number);
 
/* this does something like setlocale("C", ...) in PDFlib 3.x */
@@ -469,7 +502,7 @@
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_string_ex(arg2);
-   PDF_show(pdf, Z_STRVAL_PP(arg2));
+   PDF_show2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
RETURN_TRUE;
 }
 /* }}} */
@@ -490,7 +523,7 @@
convert_to_string_ex(arg2);
convert_to_double_ex(arg3);
convert_to_double_ex(arg4);
-   PDF_show_xy(pdf, Z_STRVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) 
Z_DVAL_PP(arg4));
+   PDF_show_xy2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), (float) 
+Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4));
RETURN_TRUE;
 }
 /* }}} */
@@ -803,7 +836,7 @@
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_string_ex(arg2);
-   PDF_continue_text(pdf, Z_STRVAL_PP(arg2));
+   PDF_continue_text2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
RETURN_TRUE;
 }
 /* }}} */
@@ -843,7 +876,12 @@
convert_to_double_ex(arg4);
size = Z_DVAL_PP(arg4);
}
-   width = (double) PDF_stringwidth(pdf, Z_STRVAL_PP(arg2), 
font-PDFLIB_FONT_OFFSET, size)

[PHP-CVS] cvs: php4 /ext/pdf pdf.c

2001-03-05 Thread Rainer Schaaf

rjs Mon Mar  5 08:18:50 2001 EDT

  Modified files:  
/php4/ext/pdf   pdf.c 
  Log:
  fixed bug in PDF_getbuffer (happend only on Windows)
  When using PDFlib V4.0 the pdf_set(grey/rgbcolor) functions are replaced
  by the PDFlib V4.0 function pdf_setcolor
  
  
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.74 php4/ext/pdf/pdf.c:1.75
--- php4/ext/pdf/pdf.c:1.74 Thu Mar  1 11:51:53 2001
+++ php4/ext/pdf/pdf.c  Mon Mar  5 08:18:50 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.74 2001/03/01 19:51:53 rjs Exp $ */
+/* $Id: pdf.c,v 1.75 2001/03/05 16:18:50 rjs Exp $ */
 /* Id: pdf.c,v 1.73 2001/02/26 06:07:11 andi Exp  */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
@@ -293,7 +293,7 @@
 #else
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
 #endif
-   php_info_print_table_row(2, "Revision", "$Revision: 1.74 $" );
+   php_info_print_table_row(2, "Revision", "$Revision: 1.75 $" );
php_info_print_table_end();
 
 }
@@ -1498,7 +1498,11 @@
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_double_ex(arg2);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "fill", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0);
+#else
PDF_setgray_fill(pdf, (float) Z_DVAL_PP(arg2));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -1517,7 +1521,11 @@
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_double_ex(arg2);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "stroke", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0);
+#else
PDF_setgray_stroke(pdf, (float) Z_DVAL_PP(arg2));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -1536,7 +1544,11 @@
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_double_ex(arg2);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "both", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0);
+#else
PDF_setgray(pdf, (float) Z_DVAL_PP(arg2));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -1557,7 +1569,11 @@
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
convert_to_double_ex(arg4);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "fill", "rgb", (float) Z_DVAL_PP(arg2), (float) 
+Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0);
+#else
PDF_setrgbcolor_fill(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), 
(float) Z_DVAL_PP(arg4));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -1578,7 +1594,11 @@
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
convert_to_double_ex(arg4);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "stroke", "rgb", (float) Z_DVAL_PP(arg2), (float) 
+Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0);
+#else
PDF_setrgbcolor_stroke(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), 
(float) Z_DVAL_PP(arg4));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -1599,7 +1619,11 @@
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
convert_to_double_ex(arg4);
+#if (PDFLIB_MAJORVERSION >= 4)
+   PDF_setcolor(pdf, "both", "rgb", (float) Z_DVAL_PP(arg2), (float) 
+Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0);
+#else
PDF_setrgbcolor(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) 
Z_DVAL_PP(arg4));
+#endif
RETURN_TRUE;
 }
 /* }}} */
@@ -2179,11 +2203,7 @@
 
if (argc == 2) {
convert_to_string_ex(arg2);
-#ifdef VIRTUAL_DIR
-   virtual_filepath(Z_STRVAL_PP(arg2), &filename);
-#else
filename = Z_STRVAL_PP(arg2);
-#endif
pdf_file = PDF_open_file(pdf, filename);
} else {
/* open in memory */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pdf pdf.c php_pdf.h

2001-03-21 Thread Rainer Schaaf

rjs Wed Mar 21 12:55:35 2001 EDT

  Modified files:  
/php4/ext/pdf   pdf.c php_pdf.h 
  Log:
  Beta2 of PDFlib V4.0 will introduce on new function (PDF_place_pdi_page)
  and PDF_close_pdi_page will lose one parameter.
  These changes are done for the phpwrapper now.
  This has no impact on PDFlib V3.x.
  
  
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.77 php4/ext/pdf/pdf.c:1.78
--- php4/ext/pdf/pdf.c:1.77 Fri Mar  9 18:21:38 2001
+++ php4/ext/pdf/pdf.c  Wed Mar 21 12:55:34 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.77 2001/03/10 02:21:38 hirokawa Exp $ */
+/* $Id: pdf.c,v 1.78 2001/03/21 20:55:34 rjs Exp $ */
 /* Id: pdf.c,v 1.73 2001/02/26 06:07:11 andi Exp  */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
@@ -185,6 +185,7 @@
PHP_FE(pdf_open_pdi, NULL)
PHP_FE(pdf_close_pdi, NULL)
PHP_FE(pdf_open_pdi_page, NULL)
+   PHP_FE(pdf_place_pdi_page, NULL)
PHP_FE(pdf_close_pdi_page, NULL)
PHP_FE(pdf_get_pdi_parameter, NULL)
PHP_FE(pdf_get_pdi_value, NULL)
@@ -293,7 +294,7 @@
 #else
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
 #endif
-   php_info_print_table_row(2, "Revision", "$Revision: 1.77 $" );
+   php_info_print_table_row(2, "Revision", "$Revision: 1.78 $" );
php_info_print_table_end();
 
 }
@@ -2684,24 +2685,50 @@
RETURN_LONG(pdi_image+PDFLIB_IMAGE_OFFSET);
 }
 
-/* {{{ proto void pdf_close_pdi_page(int pdf, int doc, int page);
+/* {{{ proto void pdf_place_pdi_page(int pdf, int page, double x, double y, double 
+sx, double sy)
+ * Place a PDF page with the lower left corner at (x, y), and scale it. */
+PHP_FUNCTION(pdf_place_pdi_page) {
+   zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
+   PDF *pdf;
+
+   if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, 
+&arg4, &arg5, &arg6) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
+
+   ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
+
+   convert_to_long_ex(arg2);
+   convert_to_double_ex(arg3);
+   convert_to_double_ex(arg4);
+   convert_to_double_ex(arg5);
+   convert_to_double_ex(arg6);
+
+   PDF_place_pdi_page(pdf,
+   Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET,
+   (float) Z_DVAL_PP(arg3),
+   (float) Z_DVAL_PP(arg4),
+   (float) Z_DVAL_PP(arg5),
+   (float) Z_DVAL_PP(arg6));
+
+   RETURN_TRUE;
+}
+
+/* {{{ proto void pdf_close_pdi_page(int pdf, int page);
  * Close the page handle, and free all page-related resources. */
 PHP_FUNCTION(pdf_close_pdi_page) {
-   zval **arg1, **arg2, **arg3;
+   zval **arg1, **arg2;
PDF *pdf;
 
-   if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == 
FAILURE) {
+   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == 
+FAILURE) {
WRONG_PARAM_COUNT;
}
 
ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
 
convert_to_long_ex(arg2);
-   convert_to_long_ex(arg3);
 
PDF_close_pdi_page(pdf,
-   Z_LVAL_PP(arg2)-PDFLIB_PDI_OFFSET,
-   Z_LVAL_PP(arg3)-PDFLIB_IMAGE_OFFSET);
+   Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
 
RETURN_TRUE;
 }
@@ -2854,7 +2881,7 @@
 PHP_FUNCTION(pdf_setcolor) {
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
-   int c1;
+   double c1;
 
if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, 
&arg4, &arg5, &arg6, &arg7) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -2870,11 +2897,11 @@
convert_to_double_ex(arg7);
 
if (0 == (strcmp(Z_STRVAL_PP(arg3), "spot"))) {
-   c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET;
+   c1 = Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET;
} else if(0 == (strcmp(Z_STRVAL_PP(arg3), "pattern"))) {
-   c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET;
+   c1 = Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET;
} else {
-   c1 = (float) Z_DVAL_PP(arg4);
+   c1 = Z_DVAL_PP(arg4);
}
 
PDF_setcolor(pdf,
Index: php4/ext/pdf/php_pdf.h
diff -u php4/ext/pdf/php_pdf.h:1.15 php4/ext/pdf/php_pdf.h:1.16
--- php4/ext/pdf/php_pdf.h:1.15 Thu Mar  1 11:51:54 2001
+++ php4/ext/pdf/php_pdf.h  Wed Mar 21 12:55:34 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_pdf.h,v 1.15 2001/03/01 19:51:54 rjs Exp $ */
+/* $Id: php_pdf.h,v 1.16 2001/03/21 20:55:34 rjs Exp $ */
 
 #ifndef PHP_PDF_H
 #define PHP_PDF_H
@@ -151,6 +151,7 @@
 PHP_FUNCTION(pdf_open_pdi);
 PHP_FUNCTION(pdf_close_pdi);
 PHP_FUNCTION(pdf_open_pdi_page);
+PHP_FUNCTION(pdf_place_pdi_page);
 PHP_FUNCTION(pdf_close_pdi_page);
 PHP_FUNCTION(pdf_get_p

[PHP-CVS] cvs: php4 /ext/pdf Makefile.in config.m4 pdf.c

2001-02-12 Thread Rainer Schaaf

rjs Mon Feb 12 09:50:39 2001 EDT

  Modified files:  
/php4/ext/pdf   Makefile.in config.m4 pdf.c 
  Log:
  added module support (for dl()) for PDFlib
  the PDF files now tell that they are generated by the PHP binding.
  
  
  
Index: php4/ext/pdf/Makefile.in
diff -u php4/ext/pdf/Makefile.in:1.6 php4/ext/pdf/Makefile.in:1.7
--- php4/ext/pdf/Makefile.in:1.6Mon May  1 15:38:31 2000
+++ php4/ext/pdf/Makefile.inMon Feb 12 09:50:37 2001
@@ -1,5 +1,8 @@
 
 LTLIBRARY_NAME= libpdf.la
 LTLIBRARY_SOURCES = pdf.c
+LTLIBRARY_SHARED_NAME= libpdf_php.la
+PDFLIB_SHARED_LIBBADD= -lpdf
+LTLIBRARY_SHARED_LIBADD  = $(PDFLIB_SHARED_LIBBADD)
 
 include $(top_srcdir)/build/dynlib.mk
Index: php4/ext/pdf/config.m4
diff -u php4/ext/pdf/config.m4:1.13 php4/ext/pdf/config.m4:1.14
--- php4/ext/pdf/config.m4:1.13 Sun Mar 26 11:47:25 2000
+++ php4/ext/pdf/config.m4  Mon Feb 12 09:50:38 2001
@@ -1,18 +1,19 @@
-dnl $Id: config.m4,v 1.13 2000/03/26 19:47:25 sas Exp $
+dnl $Id: config.m4,v 1.14 2001/02/12 17:50:38 rjs Exp $
 
 AC_MSG_CHECKING(whether to include Pdflib 3.x support)
-AC_ARG_WITH(pdflib,
-[  --with-pdflib[=DIR] Include pdflib 3.x support.
-  DIR is the pdflib install directory,
-  defaults to /usr/local.],
-[
-echo $withval
-  case "$withval" in
+
+PHP_ARG_WITH(pdflib,whether to include pdflib support,
+[  --with-pdflib[=DIR] Include pdflib 3.x support. DIR is the pdflib
+ base install directory, defaults to /usr/local
+ Set DIR to "shared" to build as dl, or "shared,DIR"
+  to build as dl and still specify DIR.])
+
+  case "$PHP_PDFLIB" in
 no)
   AC_MSG_RESULT(no) ;;
 yes)
   AC_MSG_RESULT(yes)
-  PHP_EXTENSION(pdf)
+  PHP_EXTENSION(pdf, $ext_shared)
   old_LDFLAGS=$LDFLAGS
  old_LIBS=$LIBS
  LIBS="$LIBS -ltiff -ljpeg -lpng -lz"
@@ -20,7 +21,8 @@
 [AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x. You may also 
need libtiff and libjpeg. If so, use the options --with-tiff-dir= and 
--with-jpeg-dir=)])
   LIBS=$old_LIBS
   LDFLAGS=$old_LDFLAGS
-  AC_ADD_LIBRARY(pdf)
+  PHP_SUBST(PDFLIB_SHARED_LIBADD)
+  AC_ADD_LIBRARY(pdf, PDFLIB_SHARED_LIBADD)
   AC_ADD_LIBRARY(tiff)
   AC_ADD_LIBRARY(png)
   AC_ADD_LIBRARY(jpeg)
@@ -30,7 +32,7 @@
   test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="$withval/include"
   if test -n "$PDFLIB_INCLUDE" ; then
 AC_MSG_RESULT(yes)
-PHP_EXTENSION(pdf)
+PHP_EXTENSION(pdf, $ext_shared)
 old_withval=$withval
 
 if test $HAVE_ZLIB; then
@@ -113,12 +115,10 @@
 AC_CHECK_LIB(pdf, PDF_show_boxed, [AC_DEFINE(HAVE_PDFLIB,1,[ ]) 
PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -lpdf"],
   [AC_MSG_ERROR(pdflib extension requires pdflib 3.x.)])
 LIBS=$old_LIBS
-AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib)
+   PHP_SUBST(PDFLIB_SHARED_LIBADD)
+AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib, PDFLIB_SHARED_LIBADD)
 AC_ADD_INCLUDE($PDFLIB_INCLUDE)
   else
 AC_MSG_RESULT(no)
   fi ;;
   esac
-],[
-  AC_MSG_RESULT(no)
-])
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.69 php4/ext/pdf/pdf.c:1.70
--- php4/ext/pdf/pdf.c:1.69 Wed Jan 31 23:07:09 2001
+++ php4/ext/pdf/pdf.c  Mon Feb 12 09:50:38 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.69 2001/02/01 07:07:09 steinm Exp $ */
+/* $Id: pdf.c,v 1.70 2001/02/12 17:50:38 rjs Exp $ */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -29,9 +29,9 @@
 #include "ext/standard/head.h"
 #include "ext/standard/info.h"
 #include "ext/standard/file.h"
-#include "ext/gd/php_gd.h"
 
 #if HAVE_LIBGD13
+#include "ext/gd/php_gd.h"
 #include "gd.h"
 #endif
 
@@ -193,25 +193,14 @@
 ZEND_GET_MODULE(pdf)
 #endif
 
-static void _free_pdf_image(zend_rsrc_list_entry *rsrc)
-{
-   int *pdf_image = (int *)rsrc->ptr;
-   if(pdf_image) efree(pdf_image);
-}
-
 static void _free_pdf_doc(zend_rsrc_list_entry *rsrc)
 {
-   PDF *pdf = (PDF *)rsrc->ptr;
/* RJS: TODO:
+   PDF *pdf = (PDF *)rsrc->ptr;
   check whether pdf-Pointer is still valid, before pdf_delete()
   + remove php-resource */
-   PDF_delete(pdf);
-}
-
-static void _free_outline(zend_rsrc_list_entry *rsrc)
-{
-   int *outline = (int *)rsrc->ptr;
-   if(outline) efree(outline);
+   /* PDF_delete(pdf);
+*/
 }
 
 static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
@@ -275,7 +264,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "PDF Support", "enabled" );
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
-   php_info_print_table_row(2, "Revisi