Using PDFlib with Java
======================

This file collects various pieces of information which are relevant
for deploying PDFlib in various Java environments.

Information about configuring PDFlib for use in J2EE environments
can be found in a separate document.


Using the Java samples
======================

Ant
---
The Ant "build.xml" file can be used to compile and run all the PDFlib
Java sample programs.


Eclipse
-------
In an existing or new Java project you can add a reference to the PDFlib
package as follows:

- In the Package Explorer right-click on the Java project and select
  "Java Build Path".
- Go to the "Libraries" tab, click "Add Library...", and select
  "Add External JARs..."
- Select "<pdflib-install-dir>/bind/java/pdflib.jar".
- While still in the "Libraries" tab, expand the "pdflib.jar" node and
  double-click "Native library location".
- In the dialog "Native Library Folder Configuration" click "External Folder..."
  and select the folder where the PDFlib native library is located (e.g.
  pdf_java.dll).

After these steps you can explore the list of PDFlib methods under the node
"Referenced Libraries/pdflib.jar/com.pdflib/pdflib.class/pdflib"
in the Package Explorer view. When writing new Java code Eclipse will
assist with code completion and context-sensitive help for all PDFlib methods.


Makefiles
---------
For Unix platforms the supplied Makefile can be used to compile and
run the examples.


Platform-specific Notes
=======================

Using PDFlib on Mac OS X
------------------------

The default search path for JNI libraries on OS X is as follows:

.:/usr/lib:/usr/lib/java:/lib:
/System/Library/Frameworks/JavaVM.framework/Versions/1.2/Libraries

You can extend the JNI search path by defining the DYLD_LIBRARY_PATH
with more directories.


Unix
----
On Unix/Linux platforms, after installing PDFlib it may help to update the
shared library cache via

ldconfig -v		(or similar command depending on your Unix version)

  
Using PDFlib on Linux-x86_64
----------------------------
Your Java implementation may be a standard Linux-x86 compiled version
(i.e. a 32-bit version is used on a 64-bit machine). In this case you must
use the 32-bit version of PDFlib from the PDFlib-<version>-Linux.tar.gz binary
distribution package.


Using PDFlib on HP-UX-ia64
--------------------------
Your Java implementation may be a standard HP-UX PA-RISC1.1 compiled
version. In this case you have to use the PDFlib-<version>-HP-UX.tar.gz
binary distribution.

The IA64 binary is for 64-bit Java, so you have to call "java -d64" to
use PDFlib.


Using PDFlib with ColdFusion MX
===============================

We recommend the PDFlib Java edition (instead of the COM edition) for
use with ColdFusion MX. Install the PDFlib Java edition by extracting
pdflib.jar and pdf_java.dll into a folder defined in ColdFusion MX's 
Java classpath and the system's PATH variable (might as well just use 
C:/CFusionMX/lib). If you previously used the PDFlib COM edition
with ColdFusion you have to change the <cfobject> tag parameters in
the CF file as follows:

<cfobject type="Java" name="oPDF" class="com.pdflib.pdflib" action="create">


Using PDFlib with Allaire JRun
==============================

In order to use PDFlib with JRun the following is suggested:

- Copy PDFlib.jar and lib_java.dll to the .../JRun/servers/lib directory.

- Make sure that the lib directory is contained in the servlet.jnipath
  property. This property can be set from the management console, or
  specified in a local.properties file.
