Installation instructions for PDFlib on AS/400
==============================================

Please observe the notes in the PDFlib manual regarding expected
file formats (EBCDIC text vs. ASCII text vs. binary) for several
items related to PDFlib usage. These rules must strictly be observed
in order to successfully use PDFlib on EBCDIC-based platforms.


PDFlib is delivered as a SRVPGM for the AS/400 which works with
any ILE language. The respective INCLUDE/COPY sources for
ILE/RPG and ILE/C are included in the package.

Note: PASE is not required for using PDFlib on the AS/400.

This document describes the installation steps for PDFlib on the AS/400.
PDFlib can be installed by using the installation package which is
available from http://www.pdflib.com.


Step 1: Download and unzip the PDFLIB.ZIP file
===============================================

Download the file PDFLIB_<version>.ZIP for AS/400 and save it to your local
hard disk. Unzip this file to your local hard disk.

Make sure that you have FTP access to your AS/400 and that your user
profile has QSECOFR authority to perform the installation steps.


Step 2: Transfer the PDFlib save file to the AS/400
===================================================

Start a DOS session on your PC, and initiate an FTP session against your
AS/400 executing the following command from your DOS prompt:

      FTP myAS400

Enter your AS/400 user profile and password for the logon.

Switch over to binary mode by running the FTP command:
	bin

Create a SAVF on your AS/400 by running the FTP command:
	Quote rcmd crtsavf file(qgpl/pdflib)

Transfer the file PDFLIB.SAV to your AS/400 by running the FTP command:
	Put c:\yourlocalpath\pdflib.sav qgpl/pdflib

Exit the FTP session with the FTP command 
	Quit


Step 3: Restoring the PDFlib library
====================================

You can now restore the PDFLIB objects by running the following CL commands:

	CRTLIB LIB(PDFLIB)
	RSTOBJ OBJ(*ALL) SAVLIB(PDFLIB) DEV(*SAVF) SAVF(QGPL/PDFLIB)


Step 4: Creating the IFS directories and resource files
=======================================================

After restoring all objects to the PDFLIB library, execute the following
CL command to create the IFS directories for PDFLIB including all resource
files needed to run PDFlib.

	CALL PGM(PDFLIB/PDFCRTRSC)


Step 6: Verifying the installation
================================== 

After running all installation steps you should have the following objects
in your PDFLIB library:

Object      Type      Attribute

PDFCRTRSC   *PGM      CLE           Program to create IFS directories and 
                                    Resource files
PDFLIB      *SRVPGM   CLE           Service program for PDFlib functions
PDF_JAVA    *SRVPGM   CLE           Service program for Java
H           *FILE     PF            H includes for PDFlib functions
PDFLIBRSC   *FILE     SAVF          SAVF including the resource files
QRPGLESRC   *FILE     PF            Copy modules for PDFlib constants and 
                                    prototypes when using ILE RPG
QCSRC       *FILE     PF-SRC        C Samples   


In the IFS you should find the following directory:

/pdflib/PDFLIB_<version>/fonts
/pdflib/PDFLIB_<version>/bind/c
/pdflib/PDFLIB_<version>/bind/cpp
/pdflib/PDFLIB_<version>/bind/java
/pdflib/PDFLIB_<version>/bind/rpg
/pdflib/PDFLIB_<version>/doc

In this directory PDFlib stores the resource files need to generate PDF
files.


Additional steps for Java
=========================

Make sure that the PDFLIB and PDF_JAVA SRVPGM can be found in the library
list of the jobs running your Java apps. The easiest way to achieve this
is to copy these SRVPGMs to the QGPL library. In most cases this library
is found in every LIBL.

Make sure that you have execution permission on the Java objects and
directories to run the Java samples.


PDFlib applications and Teraspace
=================================

Starting with Version V4R4M0 of OS400, IBM added new functions
for memory allocation (malloc etc.) that allow to allocate more than
16 MB of memory. These new memory functions return teraspace pointers.

Depending on the application's needs, PDFlib needs to allocate more than
16 MB. For this reason you must compile PDFlib applications with the
*TSIFC option.  If you compile PDFlib without Teraspace support you may
get unpredictable results.

In order to use these new functions specify
TERASPACE(*YES *TSIFC)
in the CRTCMOD command.

Programs/modules/service programs compiled under an earlier OS versions
can't handle these teraspace pointers. In order to let them work with
teraspace pointers, you need to recompile them with the option
TERASPACE(*YES).

If you define TERASPACE(*NO) or if you don't recompile, you will receive
a pointer exception as soon as PDFlib returns any teraspace pointer to
your application.

Starting with version V5R0M0 of OS400 you can also use teraspace for the
static and automatic storage in your programs. You would use
STGMDL(*TERASPACE) to force any programs or modules to use teraspace
for static or automatic memory.

Because this version of PDFlib runs under V4R5M0 which does not support
STGMDL(*TERASPACE) and PDFlib may work with fewer than 16MB of
static/automatic storage, PDFlib uses STGMDL(*SNGLVL).

For this reason you always have to compile your programs using PDFlib with

STGMDL(*SNGLVL) -> for static/automatic storage (>=V5R0M0 only)
TERASPACE(*YES) -> to support teraspace pointers (returned by PDFlib)


PDFlib application and large file support
=========================================

OS400 supports file sizes of >2GB starting with version V5R1M0. Because the lowest
OS400 release for this version of PDFlib is V4R5M0, it does not support large files. 