jPDF Print Guide

Setup and Installation Instructions

1) Prerequisites:

a) On Unix/Linux, the commands enscript and ps2pdf are installed and available system wide via the PATH environment variable. Note that ps2pdf uses the same options as gs (Ghostscript).

On Windows, the DOSPrinter* command is installed and visible system wide via the PATH environment variable.

*DOSPrinter is a commercial product not affiliated with jBASE.

b) jBASE 5.2 is installed

c) The jBASE spooler has been created with SP-NEWTAB

2) Download the jPDF package from the link in the email. The contents contain the software and documentation in docx and pdf formats.

The contents of the software are:

a) jPDF.b – This program is the device driver that creates the PDF files from spooler output
b) ParseOptions.b – This function is used by the jPDF driver to parse the options
c) jspform_pdf – This is the Form Type file for use on Linux/Unix platforms
d) jspform_winpdf – This is the Form Type file for use on Windows

3) Extract the contents of jpdf.tar.gz (also distributed as jpdf.zip) file:

gzip -d jpdf.tar.gz

tar -xvf jpdf.tar

(or use an application like WinZip or 7-zip)

4) Compile and catalog jPDF.b into a ‘bin’ directory visible system wide to the PATH environment variable. Compile and catalog ParseOptions.b into a ‘lib’ directory visible system wide to the JBCOBJECTLIST environment variable.

5) If the platform is Unix or Linux then place the jspform_pdf form-type file in the $JBCRELEASEDIR/config directory. If the platform is Windows then place the jspform_winpdf form-type file in the %JBCRELEASEDIR%\config directory. The reason for the different form types is due to the different end-of-line characters.

Syntax: SP-CREATE queuename PROG jPDF [options]

Usage:

Unix/Linux syntax:
jPDF -o[output directory] -q[queuename] -e[\“enscript options\”] -p[\“ps2pdf options\”]

Windows syntax:

jPDF -o[output directory] -q[queuename] -d[DOSPrinter options]

Where:

output directory *** - full path of the base directory where the PDF files will be saved

If 'output directory' is not specified then:

If '$JBCSPOOLERDIR' is defined then PDF's will go to this directory

If '$JBCSPOOLERDIR' is not defined then PDFs will go to '$JBCRELEASEDIR/jbase_data/jspooler'

***Within the 'output directory' a new directory structure will be created.

The full directory structure is:

<<output dir>> / <<queue name>> / <<account name>> / <<job_number>>.pdf

queuename - alternative name to formqueue name

If not specified then this is the name of actual form queue

enscript options - the entire option string must be wrapped in double-quotes amd the double-quotes must be ‘escaped’.

There is no limit to the order or number of options.

Use the “xxx=yyyy” version where available.

ps2pdf options - the entire option string must be wrapped in double-quotes and the double-quotes must be ‘escaped’ (see example below).

There is no limit to the order or number of options.
Use the “xxx=yyyy” version where available.

DOSPrinter options – All available options are described on the DOSPrinter website.

Do not wrap multiple options in quotes (see example below).


IMPORTANT : After the formqueue as been created you must assign the required form-type to the formqueue using the SP-TYPE command or option 3 on the SP-STATUS menu. See Examples below.

Notes concerning the options:

· Spaces can be used freely within the option string for clarity.

· Each option should only be specified once, otherwise only the last one is used.

· The –w option has been deprecated from this implementation as the temporary work files are automatically removed when the jPDF process completes. On Linux/Unix the work directory is /tmp. On Windows it is %TEMP% or C:\temp, which ever is defined first.

Examples:

SP-CREATE JPDF PROG jPDF Unix/Linux)

SP-TYPE JPDF pdf

SP-CREATE JPDF PROG jPDF.exe (Windows)

SP-TYPE JPDF winpdf

[This example uses all of the default options and values, assumes that the jPDF executable is visible via PATH. The Unix/Linux enscript -B (no header) option is included by default. The Windows example uses DOSPrinter to create the PDF.]

SP-CREATE INSTRUCTIONS PROG /home/bin/jPDF –o /home/documents –q PDF –e \”--header=Hello, world! –borders --lines-per-page=42 --pass-through\”

SP-TYPE INSTRUCTIONS pdf
[This example creates a formqueue named INSTRUCTIONS and uses the full path to the jPDF driver. The output-directory is/home/documents and the queuename is being overridden with the -q option, so PDFs will subsequently be stored in the /home/documents/PDF/accountname directory (where accountname is the user’s login name). Note the use of the xxxx=yyyy versions of the enscript options and that the double-quote marks have been ‘escaped’ as those are meta-characters that have special meaning to the operating system.]

SP-CREATE TODO PROG jPDF.exe –d/CPI17 /LAND

SP-DEVICE TODO winpdf

[This example uses DOSPrinter to create the PDF. The -d options set the Characters Per Inch to Condensed (17.14cpi) and the orientation to Landscape. Note that the options are not enclosed in quotes.]

The jBASE SP-DEVICE command can be used to change the original device specifications of an existing formequeue, e.g. SP-DEVICE INSTRUCTIONS PROG jPDF [new options]