This simple example shows how to create PDF documents from PHP

Installing the itext.jar library on a web server
-------------------------------------------------

1. Note: If you have already installed the Itext PHP classes, for example
   in /usr/share/pear, you can skip this step.

   Locate the JavaBridge.jar, the itext.jar and choose an include
   directory from the PHP include_path, for example /usr/share/pear. The
   following example assumes that JavaBridge.jar and itext.jar are in
   the current working directory. It reads both files, creates and
   installs the itext PHP classes in /usr/share/pear/.

     java -jar JavaBridge.jar --convert /usr/share/pear itext.jar

  If you don't have Java installed and you have configured the
  PHP/Java Bridge to run without Java (i.e. configured without the
  "--with-java=..." option), use:

     modules/java --convert /usr/share/pear itext.jar


2. Test the installation, type:

     php itext_pdf.php >HelloWorld.pdf

3. Copy the /usr/share/pear/itext directory over to the machine that
   hosts the web server, copy the itext_pdf.php to the web server
   document root and copy the java.so to the web server PHP extension
   directory, or copy the java directory (the pure PHP implementation)
   to the web server document root.

4. If Java is not installed on the web server machine, the bridge
   should have been configured to run without Java (omit the
   --with-java=... configure option). In this case also copy the files
   "java" and "libnatcJavaBridge.so" over to the web server PHP
   extension directory.

5. For better performance it is recommended to add a php .ini
   entry:

     extension=java.so
     [java]

   Or, if the pure PHP implementation is used, start an external
   J2EE or servlet back end, for example with the command:

     java -jar JavaBridge.jar SERVLET_LOCAL:8080

   If the bridge has been configured to run without Java, use the command:

    modules/java SERVLET_LOCAL:8080

6. Browse to:
     
     http://your.server.com/itext_pdf.php

Please see the Itext documentation for further information.
