1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 13:43:02 +02:00

- port of clibpdf module based on ClibPDF 2.x.

This module is not tested yet, it just compiles.
  I don't expect any real problem since the api hasn't changed.
  ClibPDF 1.x isn't support anymore.
This commit is contained in:
Uwe Steinmann
1999-11-22 15:28:26 +00:00
parent 541087d17a
commit 62f7420001
5 changed files with 2776 additions and 0 deletions

5
ext/cpdf/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
# $Id$
noinst_LTLIBRARIES=libphpext_cpdf.la
libphpext_cpdf_la_SOURCES=cpdf.c

2
ext/cpdf/config.h.stub Normal file
View File

@@ -0,0 +1,2 @@
/* Define if you have the zlib library */
#define HAVE_CPDFLIB 0

71
ext/cpdf/config.m4 Normal file
View File

@@ -0,0 +1,71 @@
dnl $Id$
AC_MSG_CHECKING(whether to include cpdflib support)
AC_ARG_WITH(cpdflib,
[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).
DIR is the cpdfllib install directory,
defaults to /usr.],
[
case "$withval" in
no)
AC_MSG_RESULT(no) ;;
yes)
AC_MSG_RESULT(yes)
PHP_EXTENSION(cpdflib)
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB)],
[AC_MSG_ERROR(Cpdf module requires cpdflib >= 2.)])
AC_ADD_LIBRARY(cpdf)
;;
*)
test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE="$withval/include"
if test -n "$CPDFLIB_INCLUDE" ; then
AC_MSG_RESULT(yes)
PHP_EXTENSION(cpdf)
old_LIBS=$LIBS
old_withval=$withval
AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)])
AC_ARG_WITH(jpeg-dir,
[ --with-jpeg-dir[=DIR] jpeg dir for cpdflib 2.x],[
AC_MSG_RESULT(yes)
if test -z $withval; then
withval="/usr/local"
fi
LIBS="$LIBS -L$withval/lib -ljpeg"
AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_RESULT(no)],)
AC_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
LIBS="$LIBS -L$withval/lib -ljpeg"
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-jpeg-dir=<DIR>)
])
AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)])
AC_ARG_WITH(tiff-dir,
[ --with-tiff-dir[=DIR] tiff dir for cpdflib 2.x],[
AC_MSG_RESULT(yes)
if test -z $withval; then
withval="/usr/local"
fi
LIBS="$LIBS -L$withval/lib -ljpeg"
AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no)],)
AC_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
])
withval=$old_withval
LIBS="$LIBS -L$withval/lib -ltiff"
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB)],
[AC_MSG_ERROR(Cpdflib module requires cpdflib >= 2.)])
LIBS=$old_LIBS
AC_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib)
AC_ADD_INCLUDE($CPDFLIB_INCLUDE)
else
AC_MSG_RESULT(no)
fi ;;
esac
],[
AC_MSG_RESULT(no)
])

2576
ext/cpdf/cpdf.c Normal file

File diff suppressed because it is too large Load Diff

122
ext/cpdf/php3_cpdf.h Normal file
View File

@@ -0,0 +1,122 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _PHP3_CPDF_H
#define _PHP3_CPDF_H
#if HAVE_CPDFLIB
#include <cpdflib.h>
extern php3_module_entry cpdf_module_entry;
#define cpdf_module_ptr &cpdf_module_entry
extern PHP_MINFO_FUNCTION(cpdf);
extern PHP_MINIT_FUNCTION(cpdf);
extern PHP_RINIT_FUNCTION(cpdf);
extern PHP_MSHUTDOWN_FUNCTION(cpdf);
PHP_FUNCTION(cpdf_set_creator);
PHP_FUNCTION(cpdf_set_title);
PHP_FUNCTION(cpdf_set_subject);
PHP_FUNCTION(cpdf_set_keywords);
PHP_FUNCTION(cpdf_set_viewer_preferences);
PHP_FUNCTION(cpdf_open);
PHP_FUNCTION(cpdf_close);
PHP_FUNCTION(cpdf_page_init);
PHP_FUNCTION(cpdf_finalize_page);
PHP_FUNCTION(cpdf_set_current_page);
PHP_FUNCTION(cpdf_begin_text);
PHP_FUNCTION(cpdf_end_text);
PHP_FUNCTION(cpdf_show);
PHP_FUNCTION(cpdf_show_xy);
PHP_FUNCTION(cpdf_continue_text);
PHP_FUNCTION(cpdf_text);
PHP_FUNCTION(cpdf_set_font);
PHP_FUNCTION(cpdf_set_leading);
PHP_FUNCTION(cpdf_set_text_rendering);
PHP_FUNCTION(cpdf_set_horiz_scaling);
PHP_FUNCTION(cpdf_set_text_rise);
PHP_FUNCTION(cpdf_set_text_matrix);
PHP_FUNCTION(cpdf_set_text_pos);
PHP_FUNCTION(cpdf_rotate_text);
PHP_FUNCTION(cpdf_set_char_spacing);
PHP_FUNCTION(cpdf_set_word_spacing);
PHP_FUNCTION(cpdf_continue_text);
PHP_FUNCTION(cpdf_stringwidth);
PHP_FUNCTION(cpdf_save);
PHP_FUNCTION(cpdf_restore);
PHP_FUNCTION(cpdf_translate);
PHP_FUNCTION(cpdf_scale);
PHP_FUNCTION(cpdf_rotate);
PHP_FUNCTION(cpdf_setflat);
PHP_FUNCTION(cpdf_setlinejoin);
PHP_FUNCTION(cpdf_setlinecap);
PHP_FUNCTION(cpdf_setmiterlimit);
PHP_FUNCTION(cpdf_setlinewidth);
PHP_FUNCTION(cpdf_setdash);
PHP_FUNCTION(cpdf_moveto);
PHP_FUNCTION(cpdf_rmoveto);
PHP_FUNCTION(cpdf_curveto);
PHP_FUNCTION(cpdf_lineto);
PHP_FUNCTION(cpdf_rlineto);
PHP_FUNCTION(cpdf_circle);
PHP_FUNCTION(cpdf_arc);
PHP_FUNCTION(cpdf_rect);
PHP_FUNCTION(cpdf_newpath);
PHP_FUNCTION(cpdf_closepath);
PHP_FUNCTION(cpdf_closepath_stroke);
PHP_FUNCTION(cpdf_stroke);
PHP_FUNCTION(cpdf_fill);
PHP_FUNCTION(cpdf_fill_stroke);
PHP_FUNCTION(cpdf_closepath_fill_stroke);
PHP_FUNCTION(cpdf_endpath);
PHP_FUNCTION(cpdf_clip);
PHP_FUNCTION(cpdf_setgray_fill);
PHP_FUNCTION(cpdf_setgray_stroke);
PHP_FUNCTION(cpdf_setgray);
PHP_FUNCTION(cpdf_setrgbcolor_fill);
PHP_FUNCTION(cpdf_setrgbcolor_stroke);
PHP_FUNCTION(cpdf_setrgbcolor);
PHP_FUNCTION(cpdf_add_outline);
PHP_FUNCTION(cpdf_set_page_animation);
PHP_FUNCTION(cpdf_finalize);
PHP_FUNCTION(cpdf_output_buffer);
PHP_FUNCTION(cpdf_save_to_file);
PHP_FUNCTION(cpdf_add_annotation);
PHP_FUNCTION(cpdf_import_jpeg);
#if HAVE_LIBGD13
PHP_FUNCTION(cpdf_place_inline_image);
#endif
PHP_FUNCTION(cpdf_set_action_url);
#else
#define cpdf_module_ptr NULL
#endif
#define phpext_cpdf_ptr cpdf_module_ptr
#endif /* _PHP3_PDF_H */