home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 February / PCWorld_2002-02_cd.bin / Software / Vyzkuste / pdflib / pdflib-4.0.1.sit / pdflib-4.0.1 / bind / php / readme.txt < prev   
Encoding:
Text File  |  2001-07-04  |  6.7 KB  |  194 lines  |  [TEXT/ttxt]

  1. Notes on the PDFlib PHP binding
  2.  
  3. Overview
  4. ========
  5.  
  6. With the binary distribution of PDFlib you have one main way how to use PDFlib
  7. with PHP by using the supplied loadable module. This implies some restrictions,
  8. but simplifies PDFlib deployment a lot. 
  9.  
  10. If the loadable module does not fit your needs, the binary distribution 
  11. also includes a precompiled PDFlib library (libpdf.*), to be used in your
  12. custom build process for PHP. This will allow you to integrate PDFlib
  13. (including the PDI functionality) into your own PHP build process.
  14.  
  15. Please note that the binary distribution is for commercial licensing only.
  16. If you want to use the PDF import library PDI you _must_ use the binary
  17. distribution since PDI is not available in source form.
  18.  
  19. Of course you may also use PDFlib for PHP with the source distribution, but
  20. since there are so many PHP configuration options we will only give a rough
  21. overview how to do this.
  22.  
  23. Summary:
  24.  
  25. - "Loadable Module"
  26.   The recommended way for using PDFlib with PHP.
  27.  
  28. - "Rebuild PHP"
  29.   If the loadable module does not fit your needs you can rebuild PHP with
  30.   PDFlib support, but this requires more effort than the loadable module.
  31.  
  32. - "Fonts"
  33.   Explains how to integrate your own fonts to be used with PDFlib
  34.  
  35. - "Samples"
  36.   How to set up the supplied PDFlib examples.
  37.  
  38.  
  39. Loadable Module
  40. ===============
  41.  
  42. Use the PDFlib loadable module from the "bind/php/<phpversion>" directory
  43. of the PDFlib binary distribution. The name of the loadable module depends
  44. on the platform:
  45.  
  46.     - Windows: php_pdf.dll
  47.     - Linux: libpdf_php.so
  48.     - Other Unix systems: libpdf_php.* with the appropriate shared
  49.       library suffix     
  50.  
  51. The following conditions must be met in order to use PDFlib as a
  52. loadable module:
  53.  
  54.     - PDFlib support must not already have been compiled into your PHP version.
  55.       If your PHP already includes PDFlib support (this is the case for
  56.       versions of PHP distributed with many Linux distributions) you must
  57.       rebuild PHP with the "-with-pdflib=no" configure option.
  58.     - The PDFlib loadable module (libpdf_php.*/php_pdf.dll) must be placed in
  59.       the directory specified in the php.ini variable "extension_dir".
  60.     - php.ini must include the line "safe_mode=Off".
  61.     - php.ini must include the line "enable_dl=On".
  62.     - Several properties of your PHP version must match the loadable module
  63.       of PDFlib. The supplied binary modules for PDFlib have been built as
  64.       follows:
  65.       - nondebug version
  66.       - thread-safe
  67.       - for a special PHP version, see "bind/php/<phpversion>
  68.  
  69.       If you get an error message similar to the following your PHP version
  70.       number does not match that of the PDFlib module:
  71.         Warning:  pdf: Unable to initialize module
  72.         Module compiled with debug=0, thread-safety=1 module API=20001214
  73.         PHP compiled with debug=0, thread-safety=1 module API=20001222
  74.       All of these options must match.
  75.       
  76.  
  77. If you can't meet the above conditions you must choose to "Rebuild PHP" as
  78. described below (or ask us whether your combination will be availabele soon).
  79.  
  80.  
  81. Installing the module on Windows:
  82.  
  83.     - Our DLLs have been tested with the binary PHP distribution which is
  84.       available from http://www.php4win.de
  85.  
  86.     - The PDFlib binary distribution for Windows contains several DLLs
  87.       for different versions of PHP. Currently we offer the following
  88.       flavors:
  89.  
  90.       - "php 4.0.4\php_pdf.dll" was built for php4.0.4 for win32[2000-12-20]
  91.       - "php 4.0.5\php_pdf.dll" was built for php4.0.5-rc1 for win32[2001-03-16]
  92.  
  93.     - For the PHP installation please follow the documentation of your
  94.       PHP distribution and copy "bind/php/<your phpversion>/php_pdf.dll"
  95.       to \winnt\system32.
  96.       
  97.  
  98. Installing the module on Unix:
  99.  
  100.     - The PDFlib binary distribution for Unix contains several shared libraries
  101.       for different versions of PHP. Currently we offer the following
  102.       flavors:
  103.  
  104.       - "php 4.0.4\libpdf_php.*" was built for php4.0.4pl1
  105.       - "php 4.0.5\libpdf_php.*" was built for php4.0.5
  106.  
  107.     - Copy the file libpdf_php.* from the directory "bind/php/<phpversion>"
  108.       of the PDFlib binary distribution to the directory which is specified in
  109.       the "extension_dir" line in php.ini.
  110.  
  111.  
  112. Using the module:
  113.  
  114.     - If you decide to load PDFlib each time PHP starts insert one line in
  115.       php.ini:
  116.       extension = php_pdf.dll
  117.  
  118.     - Without the "extension = ..." line in php.ini you must include the
  119.       following line in your PHP scripts:
  120.       dl("libpdf_php.so");
  121.  
  122.  
  123. Rebuild PHP
  124. ===========
  125.  
  126. When recompiling PHP using the library from the binary distribution of PDFlib
  127. you have to use the library located in the "bind/c" directory of the PDFlib
  128. distribution.
  129.  
  130. Note: Building PDFlib for PHP from the source code of PDFlib is not supported
  131. by PDFlib GmbH since we supply precompiled binaries (although it should work,
  132. and therefore you will find hints how to do it below).
  133.  
  134.  
  135. Unix
  136.     - Unpack the PDFlib binary distribution to <pdflib-dir>,
  137.       or unpack the PDFlib source distribution to <pdflib-dir>, and
  138.       issue "make; make install".
  139.     
  140.     - Copy the PDFlib support files for PHP to your PHP source tree:
  141.         
  142.       $ cp <pdflib-dir>/bind/php/ext/pdf/* <php-dir>/ext/pdf
  143.     
  144.     - For rebuilding PHP add the following to your PHP configure options:
  145.       --with-pdflib=<pdflib-dir>/bind/c
  146.       or if building PDFlib from source:
  147.       --with-pdflib[=<pdflib-install-directory>]
  148.       where <pdflib-install-directory> will typically be something like
  149.       /usr/lib or similar.
  150.  
  151.     - Now rebuild PHP as usual, and install it.
  152.  
  153. Windows
  154.     - Copy the PDFlib support files for PHP to your PHP source tree:
  155.         
  156.       C:\> copy <pdflib-dir>\bind\php\ext\pdf\*.* <php-dir>\ext\pdf
  157.       
  158.     - Now rebuild php_pdf.dll.
  159.  
  160.  
  161. Fonts
  162. =====
  163.  
  164. If you need special fonts or encodings you have to copy the contents of the
  165. "fonts" directory of the PDFlib distribution to some directory on your system.
  166.  
  167. Inform PDFlib about the location of these files by one of the following
  168. methods:
  169.  
  170.     - Set the PDFLIBRESOURCE environment variable.
  171.  
  172.     - PDF_set_parameter($p, "resourcefile", "/path/to/pdflib.upr");
  173.       PDF_set_parameter($p, "prefix", "/path/to/fonts");
  174.  
  175.     - Use PDF_set_parameter() to set all font-specific information
  176.       "FontAFM", "FontPFM", "FontOutline", "Encoding".
  177.       See the PDFlib manual for details.
  178.  
  179.     - Place "pdflib.upr" whereever the current directory is while
  180.       executing your script (not recommended). 
  181.  
  182.  
  183. Samples
  184. =======
  185.  
  186. To use the samples:
  187.  
  188.     - $ cp *.php .../htdocs #(to your htdocs directory)
  189.     - $ cp ../../doc/PDFlib-manual-activex.pdf .../htdocs #(to your htdocs)
  190.     - $ cp ../../doc/PDFlib-purchase-order.pdf .../htdocs #(to your htdocs)
  191.     - $ cp ../../test/nesrin.jpg .../htdocs #(to your htdocs)
  192.     - point your browser to the sample files
  193.     - enjoy the generated PDFs
  194.