Products   Support   Download   Contact

SELECTING PAPER TRAYS BASED ON MEDIA TYPE

Revised: 12-Aug-2002

Contents | Index | About the Icons

Abstract

ScriptServer® software is designed to select paper trays based on page size, rather than by the type of media. However, it is fairly straightforward to use some of the more advanced PostScript Level 2 features to select input trays based on arbitrary media types, or paper stock type, such as three-hole punched paper.

Note: The techniques used here require a PostScript Level 2 interpreter in the printer, as the features used were introduced in that release of the language.

Paper trays are assigned numbers by the PostScript interpreter, usually starting with 0. The number assigned to each tray differs from printer model to model. To set a PostScript language printer up so that it "knows" what media type is in a given tray, you must first determine the tray number that contains the special media type. You then create two setup modules that are placed in the ScriptServer device control library. The first module is permanently downloaded into the printer on queue startup. It associates the special media type with the tray number within the PostScript interpreter. The second module is a form setup module which requests that the PostScript interpreter select the tray with the desired media type.

Setting it up

In this example, we will use three-hole punch paper as our media type. We will use "threehole" as the media type name within PostScript. This is an arbitrary string assigned by the user; it can be any valid PostScript string as long as it is used consistently. Note that references to this name are case-sensitive.

Use the GrayMatter Software -supplied PostScript file PAPER_HANDLING.PS to generate a paper status report for your printer. (Simply PRINT it, and it generates the report.)

ScriptServer for OpenVMS customers should find this file in the SCRIPTSERVER: directory. If you don't have this file on your system or you are using the ScriptServer PAN Printing System, contact our technical support staff and we will email it (or otherwise provide it) to you. The report generated by PAPER_HANDLING lists the page size, media type, media color, and media weight associated with each input tray on the printer. It also lists the order that trays are selected in ("Tray Selection Priority") and how the printer is to handle the situation when a request cannot be fulfilled ("Paper Handling Policies").

The PostScript Components

After you have determined the tray number containing the three-hole paper there are two PostScript fragments which you need to create, one of which will be permanently downloaded to the printer to define the media type, and the other which will be used at job submission to select the media type.

Defining the Media Type

The following fragment will be used to define the media type in the printer:

%!PS-Adobe
currentpagedevice begin  
	InputAttributes 2 get begin        
		/MediaType (threehole) def
	end
end

The number following "InputAttributes" in this fragment is the tray number. Change this value ("2", in the example here) to the tray number you determined earlier.

Media Selection

The second fragment will be used to select the media type at the time the job is printed:

%!PS-Adobe
<< /MediaType (threehole) >> setpagedevice

Putting It Together

Now that you have a fragment which defines your media type and another fragment which uses it, you're ready to put the pieces together. How you do so depends on which ScriptServer product you are using. ScriptServer for OpenVMS users will need to create text files and then insert those into the device control library. ScriptServer PAN users will need to define the fragments as resources and then associate those resources with forms.

The nomenclature is somewhat different between the two products.

ScriptServer for OpenVMS

We recommend that you name the media type definition after the queue you are setting up so it's easier to keep track of which setup module goes with which printer. In this example, I'll call it QUEUE1_PAPER.PS.

After inserting it in the device control library, you can make it download permanently on queue startup (assuming a queue name of "QUEUE1") with the command:

$ DEFINE/table=SSV$DOWNLOAD_table SSV$QUEUE1_MODULES QUEUE1_PAPER

So that it is executed automatically the next time you re-boot your system, we recommend that you place this command in the ScriptServer start-up file DOWNLOAD.COM which is in the SCRIPTSERVER: directory. This file contains helpful comments to assist you.

After inserting it in the device control library, you can define a form (for this example, I'll call it THREEHOLE) that automatically selects the three-hole paper using the command:

$ DEFINE/FORM/STOCK=DEFAULT/SETUP=SELECT_THREEHOLE THREEHOLE 236

The number 236 in this command is some arbitrary unique form number.

You're now ready to use your new media type by printing with the form name, for example:

$ PRINT/QUEUE=QUEUE1/FORM=THREEHOLE MYFILE.LIS
ScriptServer PAN Printing System

A sensible thing to do would be to put the media type definition in the resource set associated with the queue which represents the printer, since there is only one queue per printer, and give it a name like "threehole". Use the resource as part of a startup form.

Create another resource with the media selection fragment and use it as part of a form definition when printing the job.


A couple of footnotes:

1) To permanently download the first setup module, the ScriptServer for OpenVMS symbiont must use the printer's "exitserver" password. On most printers, this value is the integer 0, which is what the symbiont uses by default. However, it is possible to change the password to another value, in which case, the ScriptServer symbiont will be unable to store the media type. Also, some, if not all, Digital PrintServer printers use the string LPS as the password (by default). In these cases, you must define a logical name that tells the ScriptServer symbiont what the password is.

The format of the logical name is SSV$device_EXITSERVER password where device is the name of the device (the /ON qualifier's argument) and password is the password to use. For example, if the printer is on device LTA99 and it's password is LPS, the command would be:

$ DEFINE/SYS SSV$LTA99_EXITSERVER "(LPS)"

Note the LPS is in parentheses. This is how strings are denoted within PostScript. For numeric passwords, they are omitted. For more information, see section 4.6 in the ScriptServer Printing System User Guide.

2) The form setup module used here allows you to select forms in a device-independent manner, while the permanently downloaded setup module is device-specific. So as long as the permanently downloaded setup module is configured properly for each printer, the same form setup file will work regardless of the printer.

© 2020 GrayMatter Software Corporation