add support for PDFlib 7/8/9

git-svn-id: http://svn.php.net/repository/pecl/pdf/trunk@330855 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Rainer Schaaf
2013-07-10 11:36:37 +00:00
parent 44fa333cbe
commit 15b479e7d3
8 changed files with 3918 additions and 8818 deletions

View File

@@ -6,12 +6,13 @@ PHP_ARG_WITH(pdflib,for PDFlib support,
[ --with-pdflib[=DIR] Include PDFlib support.])
if test "$PHP_PDFLIB" != "no"; then
dnl #
dnl # The main PDFlib configure
dnl #
PHP_NEW_EXTENSION(pdf, pdf.c, $ext_shared)
PHP_REQUIRE_CXX()
dnl # $6 set to "1" => use $(CXX) for linking
PHP_NEW_EXTENSION(pdf, pdf.c, $ext_shared, "", "", 1)
dnl # MacOSX requires this
case `(uname -s) 2>/dev/null || echo unknown` in
*arwin*)
@@ -23,36 +24,22 @@ if test "$PHP_PDFLIB" != "no"; then
case $PHP_PDFLIB in
yes)
AC_CHECK_LIB(pdf, PDF_open_pdi, [
AC_DEFINE(HAVE_PDFLIB,1,[ ])
PHP_ADD_LIBRARY(pdf,, PDF_SHARED_LIBADD)
],[
AC_MSG_ERROR([
PDFlib extension requires at least pdflib 4.0.x.
See config.log for more information.
])
],[
-lm $PHP_FRAMEWORKS
])
;;
*)
if test -f "$PHP_PDFLIB/include/pdflib.h" ; then
PHP_CHECK_LIBRARY(pdf, PDF_open_pdi,
[
AC_DEFINE(HAVE_PDFLIB,1,[ ])
PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDF_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_PDFLIB/include)
],[
AC_MSG_ERROR([
PDFlib extension requires at least pdflib 4.0.x.
See config.log for more information.
])
],[
-L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD -lm
])
else
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
if test -f "$PHP_PDFLIB/pdflib.h" ; then
AC_DEFINE(HAVE_PDFLIB,1,[ ])
PHP_ADD_LIBRARY_WITH_PATH(s_libpdf, $PHP_PDFLIB, PDF_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_PDFLIB)
else
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
fi
fi
;;
esac

View File

@@ -6,8 +6,8 @@ ARG_WITH("pdflib", "PDFlib support", "no");
if (PHP_PDFLIB != "no") {
if (CHECK_HEADER_ADD_INCLUDE("pdflib.h", "CFLAGS_PDFLIB", PHP_PDFLIB) &&
CHECK_LIB("gdi32.lib", "pdflib", PHP_PDFLIB) &&
( CHECK_LIB("pdflib.lib", "pdflib", PHP_PDFLIB + "\\Release_MD")
|| CHECK_LIB("pdflib.lib", "pdflib", PHP_PDFLIB)
( CHECK_LIB("pdflib.lib", "pdflib", PHP_PDFLIB + "\\Release_MD_PDFLIB")
|| CHECK_LIB("pdflib.lib", "pdflib", PHP_PDFLIB)
)
)
{

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.6.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>pdflib</name>
<channel>pecl.php.net</channel>
<summary>Creating PDF on the fly with the PDFlib library</summary>
<description>This extension wraps the PDFlib programming library
for processing PDF on the fly, created by Thomas Merz.
PDFlib is available for commercial licensing and under the PDFlib Lite License
(see http://www.pdflib.com/fileadmin/pdflib/pdf/license/PDFlib-Lite-license.pdf)
for processing PDF on the fly, available from PDFlib GmbH
at http://www.pdflib.com.
More info on how to use PDFlib with PHP can be found at
http://www.pdflib.com/developer-center/technical-documentation/php-howto</description>
@@ -17,47 +15,40 @@ http://www.pdflib.com/developer-center/technical-documentation/php-howto</descri
<email>rjs@php.net</email>
<active>yes</active>
</lead>
<lead>
<name>Uwe Steinmann</name>
<user>steinm</user>
<email>steinm@php.net</email>
<active>yes</active>
</lead>
<date>2012-06-05</date>
<time>12:26:02</time>
<date>2013-07-10</date>
<time>12:00:00</time>
<version>
<release>2.1.9</release>
<api>2.1.9</api>
<release>3.0.0</release>
<api>3.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>- added support for PHP 5.4
</notes>
<notes>
- support PDFlib 9
- fix bug https://bugs.php.net/bug.php?id=64455
</notes>
<contents>
<dir name="/">
<file md5sum="844f5da74837609fd18ac6fca5a0f2a9" name="config.m4" role="src" />
<file md5sum="ae5d284ca16585172380c5550cce4d60" name="config.w32" role="src" />
<file md5sum="000f2db5a0795df72b7d3d34dc9f4d93" name="CREDITS" role="doc" />
<file md5sum="f9d162e4d8569d1544760ef928f9a290" name="pdf.c" role="src" />
<file md5sum="057ac0cf52c2f05ba4f4693a661cf31b" name="pdf4.c" role="src" />
<file md5sum="2b79febad8f3a23a5cc585ad596d3cff" name="pdf7.c" role="src" />
<file md5sum="67b05794cde35af57b750a9af3eeedd6" name="pdflib.dsp" role="src" />
<file md5sum="5468027eb7a754bc66b08ea43b9ddc9f" name="php_pdflib.h" role="src" />
<file md5sum="2d854ac0a2bcc73590c11162e03b101b" name="php_pdf4.h" role="src" />
<file md5sum="d85afe9168de61d744ca40d7b79facff" name="php_pdf7.h" role="src" />
<file md5sum="bf952e6eba8517845f121237550f27bf" name="php_wrapped.c" role="src" />
<file name="config.m4" role="src" />
<file name="config.w32" role="src" />
<file name="CREDITS" role="doc" />
<file name="pdf.c" role="src" />
<file name="pdflib.dsp" role="src" />
<file name="php_pdflib.h" role="src" />
<file name="php_pdf.h" role="src" />
<file name="php_wrapped.c" role="src" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>4.1</min>
<min>5.2.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
<min>1.4.0</min>
</pearinstaller>
</required>
</dependencies>

7124
pdf.c

File diff suppressed because it is too large Load Diff

View File

@@ -101,18 +101,6 @@ SOURCE=.\pdf.c
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\php_pdf.h
# End Source File
# Begin Source File
SOURCE=.\pdf4.h
# End Source File
# Begin Source File
SOURCE=.\php_pdf4.h
# End Source File
# End Group
# Begin Group "Resource Files"

197
php_pdf.h
View File

@@ -1,20 +1,3 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
/* Derived from:
@@ -34,179 +17,23 @@ PHP_MINFO_FUNCTION(pdf);
PHP_MINIT_FUNCTION(pdf);
PHP_MSHUTDOWN_FUNCTION(pdf);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_activate_item);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_add_bookmark);
PHP_FUNCTION(pdf_add_launchlink);
PHP_FUNCTION(pdf_add_locallink);
PHP_FUNCTION(pdf_add_nameddest);
PHP_FUNCTION(pdf_add_note);
PHP_FUNCTION(pdf_add_pdflink);
PHP_FUNCTION(pdf_add_thumbnail);
PHP_FUNCTION(pdf_add_weblink);
PHP_FUNCTION(pdf_arc);
PHP_FUNCTION(pdf_arcn);
PHP_FUNCTION(pdf_attach_file);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_begin_document);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_begin_font);
PHP_FUNCTION(pdf_begin_glyph);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_begin_item);
PHP_FUNCTION(pdf_begin_layer);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_begin_page);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_begin_page_ext);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_begin_pattern);
PHP_FUNCTION(pdf_begin_template);
PHP_FUNCTION(pdf_circle);
PHP_FUNCTION(pdf_clip);
PHP_FUNCTION(pdf_close);
PHP_FUNCTION(pdf_close_image);
PHP_FUNCTION(pdf_close_pdi);
PHP_FUNCTION(pdf_close_pdi_page);
PHP_FUNCTION(pdf_closepath);
PHP_FUNCTION(pdf_closepath_fill_stroke);
PHP_FUNCTION(pdf_closepath_stroke);
PHP_FUNCTION(pdf_concat);
PHP_FUNCTION(pdf_continue_text);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_create_action);
PHP_FUNCTION(pdf_create_annotation);
PHP_FUNCTION(pdf_create_bookmark);
PHP_FUNCTION(pdf_create_field);
PHP_FUNCTION(pdf_create_fieldgroup);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_create_gstate);
PHP_FUNCTION(pdf_create_pvf);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_create_textflow);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_curveto);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_define_layer);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_delete);
PHP_FUNCTION(pdf_delete_pvf);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_delete_textflow);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_encoding_set_char);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_end_document);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_end_font);
PHP_FUNCTION(pdf_end_glyph);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_end_item);
PHP_FUNCTION(pdf_end_layer);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_end_page);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_end_page_ext);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_end_pattern);
PHP_FUNCTION(pdf_end_template);
PHP_FUNCTION(pdf_endpath);
PHP_FUNCTION(pdf_fill);
PHP_FUNCTION(pdf_fill_imageblock);
PHP_FUNCTION(pdf_fill_pdfblock);
PHP_FUNCTION(pdf_fill_stroke);
PHP_FUNCTION(pdf_fill_textblock);
PHP_FUNCTION(pdf_findfont);
PHP_FUNCTION(pdf_fit_image);
PHP_FUNCTION(pdf_fit_pdi_page);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_fit_textflow);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_fit_textline);
PHP_FUNCTION(pdf_get_apiname);
PHP_FUNCTION(pdf_get_buffer);
PHP_FUNCTION(pdf_get_errmsg);
PHP_FUNCTION(pdf_get_errnum);
PHP_FUNCTION(pdf_get_parameter);
PHP_FUNCTION(pdf_get_pdi_parameter);
PHP_FUNCTION(pdf_get_pdi_value);
PHP_FUNCTION(pdf_get_value);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_info_textflow);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_initgraphics);
PHP_FUNCTION(pdf_lineto);
PHP_FUNCTION(pdf_load_font);
PHP_FUNCTION(pdf_load_iccprofile);
PHP_FUNCTION(pdf_load_image);
PHP_FUNCTION(pdf_makespotcolor);
PHP_FUNCTION(pdf_moveto);
#define _WRAP_FUNCTION_ENTRY3
#include "php_wrapped.c"
#undef _WRAP_FUNCTION_ENTRY3
PHP_FUNCTION(pdf_new);
PHP_FUNCTION(pdf_open_ccitt);
PHP_FUNCTION(pdf_open_file);
PHP_FUNCTION(pdf_open_image);
PHP_FUNCTION(pdf_open_image_file);
PHP_FUNCTION(pdf_delete);
PHP_FUNCTION(pdf_get_pdi_parameter);
PHP_FUNCTION(pdf_open_pdi);
PHP_FUNCTION(pdf_open_pdi_page);
PHP_FUNCTION(pdf_place_image);
PHP_FUNCTION(pdf_place_pdi_page);
PHP_FUNCTION(pdf_process_pdi);
PHP_FUNCTION(pdf_rect);
PHP_FUNCTION(pdf_restore);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_resume_page);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_rotate);
PHP_FUNCTION(pdf_save);
PHP_FUNCTION(pdf_scale);
PHP_FUNCTION(pdf_set_border_color);
PHP_FUNCTION(pdf_set_border_dash);
PHP_FUNCTION(pdf_set_border_style);
PHP_FUNCTION(pdf_set_gstate);
PHP_FUNCTION(pdf_set_info);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_set_layer_dependency);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_set_parameter);
PHP_FUNCTION(pdf_set_text_pos);
PHP_FUNCTION(pdf_set_value);
PHP_FUNCTION(pdf_setcolor);
PHP_FUNCTION(pdf_setdash);
PHP_FUNCTION(pdf_setdashpattern);
PHP_FUNCTION(pdf_setflat);
PHP_FUNCTION(pdf_setfont);
PHP_FUNCTION(pdf_setlinecap);
PHP_FUNCTION(pdf_setlinejoin);
PHP_FUNCTION(pdf_setlinewidth);
PHP_FUNCTION(pdf_setmatrix);
PHP_FUNCTION(pdf_setmiterlimit);
PHP_FUNCTION(pdf_setpolydash);
PHP_FUNCTION(pdf_shading);
PHP_FUNCTION(pdf_shading_pattern);
PHP_FUNCTION(pdf_shfill);
PHP_FUNCTION(pdf_show);
PHP_FUNCTION(pdf_open_image);
PHP_FUNCTION(pdf_show_boxed);
PHP_FUNCTION(pdf_show_xy);
PHP_FUNCTION(pdf_skew);
PHP_FUNCTION(pdf_stringwidth);
PHP_FUNCTION(pdf_stroke);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_suspend_page);
#endif /* PDFlib >= 6.0.0 */
PHP_FUNCTION(pdf_translate);
#if PDFLIB_MAJORVERSION >= 6
PHP_FUNCTION(pdf_setpolydash);
PHP_FUNCTION(pdf_utf16_to_utf8);
PHP_FUNCTION(pdf_utf32_to_utf16);
PHP_FUNCTION(pdf_utf8_to_utf16);
#endif /* PDFlib >= 6.0.0 */
#if PDFLIB_WITH_GD_SUPPORT
#if HAVE_LIBGD13
/* not supported by PDFlib GmbH */
PHP_FUNCTION(pdf_open_memory_image);
#endif
#endif /* PDFLIB_WITH_GD_SUPPORT */
PHP_FUNCTION(pdf_utf32_to_utf8);
PHP_FUNCTION(pdf_utf8_to_utf32);
PHP_FUNCTION(pdf_utf16_to_utf32);
#ifdef ZTS
#define PDFG(v) TSRMG(pdf_globals_id, php_pdf_globals *, v)

View File

@@ -1,3 +1,3 @@
/* $Id$ */
#define PHP_PDFLIB_VERSION "2.1.9"
#define PHP_PDFLIB_VERSION "3.0.0"

File diff suppressed because it is too large Load Diff