Building PDFlib on EBCDIC platforms
===================================

PDFlib can be used on EBCDIC-based midrange and mainframe platforms
such as IBM AS/400 and S/390 (with the "Unix system services for OS/390").
PDF generation on EBCDIC systems is a delicate issue since PDF is based
on ASCII operators, but nevertheless we want to be able to process EBCDIC
text strings. However, PDFlib is carefully set up to meet these requirements.


Compiling PDFlib
================

PDFlib internally distinguishes between items which must be converted
as text, and items which must be handled in binary mode.

PDFlib's EBCDIC support is built on the following assumptions:

- The package is extracted and all source files converted to EBCDIC.
  On the AS/400 the EBCDIC codepage (CCSID) 819 is assumed, on S/390 
  CCSID 1047.  Other systems must manually select the required codepage
  by #define'ing #PDF_CODEPAGE in p_config.h appropriately. 

- ASCII support libraries (such as IBM's libascii) are not required,
  and must not be used.

- The C source code strings must not translated automatically back to
  ISO 8859-1 by some compiler directive or similar means (for example,
  setting the __STRING_CODE_SET__ #define), but must be processed as
  EBCDIC text.

- The identifier "PDFLIB_EBCDIC" is #define'd via a test in the PDFlib
  source code (in p_config.h).

- Currently there is no support for shared libraries on EBCDIC systems.

- Using the PDFlib auxiliary libraries on EBCDIC systems:
  - libpng and zlib are believed to be EBCDIC-safe.
  - TIFFlib may also be EBCDIC-safe, but has not been tested on EBCDIC
    systems.


Using PDFlib
============

As with the source code compilation, special care must be taken when
using PDFlib in an EBCDIC environment since some items must be handled
as text (resulting in internal conversion), while others must be handled
as binary data.

PDFlib expects the following items in EBCDIC text format if compiled
in EBCDIC mode:

- PFA font files, UPR configuration files, AFM font metrics files
- document information (EBCDIC or Unicode, see reference manual)
- string parameters to PDFlib functions
- input and output file names
- environment variables (if supported at all)

- PDFlib error messages are also generated in EBCDIC format

In contrast, the following items must be treated in binary mode:
- PDF output files
- PFB font files and PFM font metrics files
- JPEG, GIF, TIFF, PNG, CCITT image files
