# Compaq DECprint Supervisor (DCPS) for OpenVMS
User's Guide

Previous | Contents | Index

# Chapter 14
Controlling File Separation Pages

The printing system can produce both job separation pages (job burst pages, job flag pages, and job trailer pages) and file separation pages. The system manager can define the job separation pages and default file separation pages for the queue. Users cannot affect the job separation pages, but can control whether to print file separation pages.

Files in a print job can be separated by:

- File burst pages
- File flag pages
- File trailer pages

You can control the inclusion of file flag pages using the following PRINT command qualifiers:

- /BURST for file burst pages at the start of a file in the print job.
  /NOBURST to prevent printing of file burst pages.
- /FLAG for file flag pages at the start of a file in the print job.
  /NOFLAG to prevent printing of file flag pages.
- /TRAILER for file trailer pages following a file in the print job.
  /NOTRAILER to prevent printing of file trailer pages.

# 14.1 Controlling File Separation Pages for All Files

You can specify the default file separation behavior for all files in a print job by placing the /[NO]BURST, /[NO]FLAG, and /[NO]TRAILER qualifiers between the PRINT command and the first file specification.

For example, the following command will print a file burst page before each file:

    $ PRINT /BURST FIRST.TXT, SECOND.TXT

If you do not specify the behavior for a type of file separation page (for example, the above command does not specify flag or trailer pages), the default behavior is as specified by the queue's /DEFAULT qualifier. If /DEFAULT does not specify a particular type of separation page, then none is generated.

The negated qualifiers (for example, /NOTRAILER), are useful in overriding a queue's default qualifier (for example, /DEFAULT=TRAILER).

# 14.2 Controlling File Separation Pages for Individual Files

You can alter the default file separation page behavior for individual files within a print job by placing the qualifiers after the corresponding file specifications.

For example, you can use the following command to override a queue's /DEFAULT=BURST qualifier and instead print file flag pages for all but the second file in a job:

    $ PRINT /NOBURST /FLAG FIRST.TXT, SECOND /NOFLAG, THIRD

# 14.3 Displaying the Default Separation Pages for a Queue

To see the default separation pages for a queue, enter the following command:

    $ SHOW QUEUE /FULL PS20$A14

    Printer queue PS20$A14, on STAR::LPS, mounted form DCPS$DEFAULT
    (stock=DEFAULT)
        /BASE_PRIORITY=4 /DEFAULT=(FLAG,FORM=DCPS$DEFAULT (stock=DEFAULT))
        /NOENABLE_GENERIC /LIBRARY=DCPS_LIB Lowercase /OWNER=[SYS,SYSTEM]
        /PROCESSOR=DCPS$SMB /PROTECTION=(S:E,O:RD,G,W:W)
        /SCHEDULE=(NOSIZE)
        /SEPARATE=(BURST,TRAILER)

This display shows that the job burst pages and job trailer pages are printed for print jobs sent to this queue (/SEPARATE=(BURST,TRAILER)). File flag pages are printed by default, as indicated by /DEFAULT=FLAG, but can be overridden by PRINT command qualifiers.

# 14.4 Job Log and Trailer Pages Sent to Default Tray On Error

The job log and job trailer pages, if any, are normally directed to the output tray you specified with the OUTPUT_TRAY parameter. However, if DCPS reports a NOOUTTRAY, OUTTRAYNOTAVL, or OUTTRAYMISMATCH error when initially attempting to select the specified output tray, the job log and trailer pages are instead directed to the printer's default output tray so that you get an indication of the problem.

# Chapter 15
Selecting Finishing Options

Some printers have a finisher, often sold as an option, that can punch or staple your output. This chapter describes how to select these printer features from DCPS.

# 15.1 Punching

DCPS can punch your job if the printer has a puncher installed. Punching with DCPS is supported on the following printers:

- GENICOM Intelliprint mL450
- GENICOM LN45
- Lexmark Optra W810
- Lexmark W820

## 15.1.1 PUNCH DCL Syntax

Punching is specified with the PRINT parameter PUNCH.

    $ PRINT /PARAMETERS=(..., [ PUNCH | NOPUNCH ] ,...) file_name

There are no values to the PUNCH parameter. The position of the punched holes is determined by the orientation of the paper in the printer, and the number and spacing of holes is determined by the printer. When NOPUNCH is specified, the job is printed without punching, overriding the printer's default punch setting.

# 15.2 Stapling

DCPS can staple your job if the printer has a stapler installed. Stapling with DCPS is supported on the following printers:

- Compaq Laser Printer LN32
- Compaq Laser Printer LNM40
- GENICOM Intelliprint mL450
- GENICOM LN45
- GENICOM LNM40
- GENICOM microLaser 320
- GENICOM microLaser 401
- HP LaserJet 8000
- HP LaserJet 8100
- HP LaserJet 8150
- HP LaserJet 9000
- Lexmark W820

## 15.2.1 STAPLE DCL Syntax

Stapling is specified with the PRINT parameter STAPLE.

    $ PRINT /PARAMETERS=(..., STAPLE = [ LEFT_CENTER |
                                         TOP_CENTER  |
                                         TOP_LEFT    |
                                         TOP_RIGHT   |
                                         NONE ]
                                         ,...) file_name

These values specify the position of the staple with respect to the orientation of the image on the paper. When NONE is specified, the job is printed without stapling, overriding the printer's default staple setting.

## 15.2.2 Stapling Positions

Some of the values for the STAPLE parameter are not always possible, depending on the direction in which the paper is fed through the printer. See Table 15-1 for possible stapling positions depending on your job's page orientation and the printer's paper feed direction. In the table, "Port" and "Land" refer to portrait and landscape page orientation, and "LEF" and "SEF" refer to long-edge-feed and short-edge feed direction of paper in the printer.

Table 15-1 Stapling Positions and Paper Feed Direction
| Staple Position and Image Orientation
--- | ---
| TOP_LEFT | TOP_CENTER | TOP_RIGHT | LEFT_CENTER
Printer Brand | Port | Land | Port | Land | Port | Land | Port | Land
Compaq, GENICOM, Lexmark, Xerox | LEF, SEF | LEF, SEF | SEF | LEF | SEF | LEF | LEF | SEF
HP | LEF, SEF |  | SEF | LEF |  | LEF | LEF | SEF

If you specify an unsupported staple position, DCPS issues the error message STPPOSNOSUP and does not print the job.

## 15.2.3 Output Trays

Stapled output can only be delivered to the output trays attached to the finisher. Table 15-2 lists the supported output trays for each printer.

Table 15-2 Output Trays Supported for Stapling
Printer Brand | Output Trays
--- | ---
Compaq, GENICOM, Xerox | STACKER / BIN_1
| BIN_2
| BIN_3
HP, Lexmark | STACKER / BIN_2

If you specify a tray not supported for stapling, or do not specify a tray but the printer's default output tray is not supported for stapling, DCPS issues the error message STPOUTTRAY and does not print the job.

## 15.2.4 Paper Sizes

Printers do not support stapling on every paper size and feed direction. See Table 15-3 for a list of paper sizes and feed directions not supported. If neither feed direction LEF (long-edge feed) or SEF (short-edge feed) is listed, neither feed direction is supported for that size.

Table 15-3 Paper Sizes and Feed Directions Not Supported for Stapling
Printer Brand | Paper Size and Feed Direction
--- | ---
Compaq, GENICOM | 7_ENVELOPE (LEF)
| A5 (SEF)
| A6 (SEF)
| BUSINESS_ENVELOPE (LEF)
| C5_ENVELOPE (LEF)
| DL_ENVELOPE (LEF)
| HALFLETTER (SEF)
HP | 7_ENVELOPE
| B5
| BUSINESS_ENVELOPE
| C5_ENVELOPE
| DL_ENVELOPE
Xerox | A6 (SEF)
| 7_ENVELOPE (LEF)
| BUSINESS_ENVELOPE (LEF)
| C5_ENVELOPE (LEF)
| DL_ENVELOPE (LEF)

If you specify a size that cannot be stapled, DCPS issues the error message STPSIZENOSUP and does not print the job.

## 15.2.5 Stapling Details

Please note the following details when using stapling with DCPS:

- Single sheet jobs are not stapled.
- If no STAPLE parameter is specified, the printer's default stapling setting is used. If the printer's default is set to staple all jobs and you do not want your DCPS job stapled, specify STAPLE=NONE.
- If the printer has a tray called STAPLER, the printer's default staple position will be used instead of the position specified in the DCPS print command.
- If the number of sheets in your job exceeds the printer's stapling capacity (usually around sixty sheets), your job is printed but not stapled.
- Job separator pages, if any, are not stapled. File separator pages, if any, are stapled with your file.
- A file that calls for multiple paper sizes cannot be stapled.
- PCL files will be stapled if requested. They will be translated to PostScript using the DCPS PCL4 translator, rather than being interpreted by the printer's native PCL interpreter. If your PCL file contains any PCL escape sequences introduced after PCL4, the sequences will be ignored.
- When using the NUMBER_UP parameter, the image orientation on the page may change. This affects the relative position of the staple, as seen in the example in Figure 15-1. The X indicates the staple positions when specifying STAPLE, NUMBER_UP and PAGE_ORIENTATION parameters. (PAGE_ORIENTATION=PORTRAIT is the default if not specified.)

  Figure 15-1 Effects of NUMBER_UP on Stapling

# Chapter 16
Using the Error Handler to Debug

The device control library includes an error handler to help debug PostScript programs. The error handler prints the last partial page of output, as well as information to help identify the error.

# 16.1 Including the Error Handler in a Print Job

The error handler is not automatically included each time a job prints (unless your system manager has changed this default). Therefore, you must explicitly invoke it, as follows:

    $ PRINT/SETUP=LPS$ERRORHANDLER filename

The error handler returns PostScript messages. You can send these messages to a file or printer by using the /PARAMETERS=MESSAGES qualifier as described in Chapter 17. For example:

    $ PRINT/QUEUE=PS40$A10/PARAMETERS=MESSAGES=KEEP FILE.PS

If you are developing PostScript applications, you can make the error handler easier to access by defining a form to include the error handling setup module, as described in Chapter 12.

# 16.2 How the Error Handler Affects the PostScript Environment

The error handler references operators from the dictionary systemdict, rather than using definitions that may have been modified by the user program.

In some cases, a program can behave differently when the error handler is loaded. For example, executing the exit operator outside a looping context causes an invalidexit error if the error handler is not loaded. However, if the error handler is loaded, the program exits without generating an error.

# 16.3 Error Handler Example

The sample log file in Example 16-1 is for the following PostScript program:

    [/1st-level [/2nd-level [/3rd-level [/4th-level 56 ] ] ] (end)]
    /myproc { [ 8 8 ] 0 0 div setdash } def
    100 200 moveto
    myproc

The following command includes the error handler and causes a log file to be generated:

    $ PRINT/PARAMETERS=MESSAGES=KEEP/SETUP=LPS$ERRORHANDLER filename

Example 16-1 shows the error handler output that is appended to the log file when the program executes.

Example 16-1 Sample Error Handler Log File

    ERROR: undefinedresult (1)
    OFFENDING COMMAND: div (2)

    OPERAND STACK:  (3)

    0
    0
    [ 8 8 ]
    [/1st-level [/2nd-level [/3rd-level  -array- ] ] (end) ]

    EXECUTION STACK: (4)

    { setdash }

    GRAPHICS STATE:  (5)
    Current Matrix: [ 4.16667 0.0 0.0 -4.16667 0.0 3298.0 ]
    Color: 0.0
    Current position: x = 100.0, y = 200.0
    Line width: 1.0
    Line cap: 0
    Line join: 0
    Flatness: 1.0
    Miter limit: 10.0
    Dash pattern: [ ] 0.0

The array defined at the start of the example file is expanded three levels deep. The innermost version of the array is represented simply as --array--.

# 16.4 Reading Error Handler Output

When an error occurs, the error handler executes a showpage command to print the last partial page of output (see Example 16-1). It also gives the following information:

1. The name of the error
2. The PostScript operator that encountered the error
3. The contents of the operand stack
   The error handler displays the value of each object on the stack, with numbers in decimal. All elements of arrays and procedures are displayed recursively to a maximum depth of three levels. Indicators describe other objects, for example, --savelevel-- for a save object.
   The first item displayed is the object on the top of the stack.
4. The contents of the execution stack
   The execution stack contains partial procedures that are being executed. The top object is a procedure that contains the operators and operands still to be executed. The second object is the unexecuted part of the calling procedure.
5. Information about the graphics state:
   - Current transformation matrix
   - Color (a currentgray value)
   - Current position
   - Line width
   - Line cap
   - Line join
   - Flatness
   - Miter limit
   - Dash pattern

When you find an error in the PostScript code, you should modify the application that produced the file, or inform the applications programmer of the problem.

# 16.5 PostScript Data Output Format

PostScript data is easily identifiable, usually in the way the data appears in a PostScript source file. The error handler represents PostScript data as follows:

- Arrays are displayed recursively, so that each element in an array is fully expanded, even if it is another array. Objects in an array are expanded only to a depth of three, to prevent indefinite recursion when displaying an array that contains itself.
  Arrays are executable and nonexecutable. Executable arrays are procedures displayed in braces ({ }) and nonexecutable arrays are displayed as several objects in brackets ([ ]). If the array has no read access or if the recursion depth has been exceeded, the array is represented by one of the following:
  - --array-- for normal arrays
  - --proc-- for executable arrays
  - --packedarray-- for packed arrays
  - --packedproc-- for packed executable arrays
- A Boolean object is represented by TRUE or FALSE, depending on its value.
- A dictionary object is represented by --dictionary--.
- A file object is represented by --filestream--.
- A font object is represented by --fontid--.
- An integer is represented by a decimal number.
- A mark object is represented by --mark--.
- A name object is represented by the literal name of the object, preceded by a slash for literal names.
- A null object, for example, the initial value of each element of an uninitialized array, is represented by --null--.
- An operator is represented by the operator name, preceded by two slashes.
- A real object is represented by a decimal number, with a decimal point and at least one digit after the decimal point.
- A save object is represented by --savelevel--.
- A string object is represented by the ASCII text of the string in parentheses, just as the string would be entered in a PostScript file.

The PostScript language may be extended to include new data formats that are unknown to the error handler. Data in unknown formats is represented as two question marks followed by the name of the unknown data format.

# 16.6 Determining Where the Error Occurred

It may be impossible to determine exactly where in the PostScript stream the error occurred, because the execution stack may not uniquely identify the context. In this case, you can add diagnostics information to the PostScript file. For example, if the error appears to be related to a showpage definition, modify your PostScript code as follows:

    /myshowpage
       {
       (At the top of my showpage\n) print flush
       % some PostScript code
       (Just before real showpage call\n) print flush
       showpage
       } def

Previous | Next | Contents | Index