Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?


Document Scope

This document covers the use of the jBASE Spool2pdf utility and is intended to be read as a companion to the Spooler documentation.

Prerequisites / Installation

1. On Linux/AIX, 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.

2. Ensure jBASE is installed, appropriately licensed, and the jBASE spooler has been created with SP-NEWTAB.

3. Download the spool2pdf.zip package and use the appropriate distribution for your platform. The package contains:  

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

4. Extract the contents of jPDF.tar.gz (Linux/AIX) or jPDF.zip  (Windows): 

gzip -d jPDF.tar.gz
tar -xvf jPDF.tar

 (or use an application like WinZip or 7-zip

5. 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.

6. If the platform is Linux or AIX 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.

Create the Form Queue:

SP-CREATE queue_name PROG jPDF [Options]



jPDF -o[output directory] -q[queuename] -e[\“enscript options\”] -p[\“ps2pdf options\”]


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


  • output directory - the full path of the base directory where the PDF files will be saved. If output directory is not specified then print jobs will go to $JBCSPOOLERDIR or $JBCDATADIR/jbase_data/jspooler, in that order. $JBCDATADIR defaults to $JBCRELEASEDIR.

    The full directory structure is:  <output directory> / <account> / <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 and 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 examples under Usage). 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. It is not recommended to wrap multiple options in quotes (see example under 'usage' ).


Options can be placed in any order.

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

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

On Linux/AIX the work directory is /tmp. On Windows it is %TEMP% or C:\temp, which ever is defined first.


After the form queue has been created, it must be assigned the required form-type using the SP-TYPE command or option 3 on the SP-STATUS menu. 

Examples of use are as : 

On Linux/AIX:


On Windows: 


This example uses all of the default options and values and 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\”

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.


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 form  queue, e.g. 


See Also: Spooler

Was this article helpful?