SpoolCmd: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Also see the [[PRINTING]] chapter.
SPOOLCMD is mainly useful for producing print files for Linux and MAC systems. In Windows systems the DIRECT://printer-name is preferred. Also see the [[PRINTING]] section.


Basically, SpoolCmd provides a description of how to print data sent to the printer.
Basically, SpoolCmd provides a description of how to print data sent to the printer.
Line 5: Line 5:
Business Rules supports independent spoolers on all systems. The [[BRConfig.sys]] SPOOLCMD specification will make a [[shell call]] to issue the necessary spool command whenever printing is done. When this is invoked the spooler is responsible for removing the spool file created by Business Rules.
Business Rules supports independent spoolers on all systems. The [[BRConfig.sys]] SPOOLCMD specification will make a [[shell call]] to issue the necessary spool command whenever printing is done. When this is invoked the spooler is responsible for removing the spool file created by Business Rules.


The spool command and its parameters can be specified in a CONFIG command or in the BRConfig.sys file as follows:
===Syntax===
SPOOLCMD [SPOOLFILE] [NAME=<name>] [QUEUE] [PRINTER] [COPIES] [WSID] [PROGRAM] [QUEUE] [PRINTER]
 
The spool command and its parameters can be specified in a [[CONFIG]] command or in the [[BRConfig.sys]] file as follows:


[[file:Spoolcmd.png|750px]]
[[file:Spoolcmd.png|750px]]


Business Rules can also make substitutions as follows in parameters specified with SPOOLCMD:
Business Rules can also make substitutions as follows in parameters specified with SPOOLCMD (they're all optional):


'''[SPOOLFILE]''' substitutes the name of the spool file, as determined by Business Rules.
'''[SPOOLFILE]''' substitutes the name of the spool file, as determined by Business Rules.
Line 19: Line 22:
'''[PRINTER]''' substitutes the "printerclass" string as specified in the [[OPEN display]] statement. For example, PRN:/printerclass.
'''[PRINTER]''' substitutes the "printerclass" string as specified in the [[OPEN display]] statement. For example, PRN:/printerclass.


'''[WSID]''' substitutes the workstation ID as specified at start-up or by the BRConfig.sys WSID spec.
'''[COPIES]''' substitutes the value of the COPIES= parameter as specified in the OPEN display statement.
 
'''[WSID]''' substitutes the user's workstation ID.


'''[PROGRAM]''' substitutes the name of the program that is loaded at the time that the printer is closed.
'''[PROGRAM]''' substitutes the name of the program that is loaded at the time that the printer is closed.


The '''[QUEUE]''' and '''[PRINTER]''' parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.
The '''[QUEUE]''' and '''[PRINTER]''' parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.
The following is an example of the SPOOLCMD specification used with the WBSPOOL utility (see [[WBSPOOL.EXE]] in the [[Other Changes/Enhancements]] section for more information:)
SPOOLCMD wbspool -Q[PRINTER] -E [&ERRNO][SPOOLFILE]


NOTE: The spoolfile created by Business Rules will not automatically be deleted.
NOTE: The spoolfile created by Business Rules will not automatically be deleted.


On DOS and Windows, if [[CONFIG]] SPOOLCMD is not specified, it opens to PRN: and will return error [[6298]] if the printer is not ready.
SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The Windows Client SPOOLCMD syntax is:
 
SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The new SPOOLCMD syntax is:


   SPOOLCMD [@] [-w] command  parm-1 parm-2 ...
   SPOOLCMD [@] [-w] command  parm-1 parm-2 ...
Line 46: Line 45:
*[[SpoolFile]]
*[[SpoolFile]]
*[[SpoolPath]]
*[[SpoolPath]]
==Config Spoolcmd==
As of 4.3, the [[CONFIG]] command supports the SPOOLCMD spec, which enables any system spooler to work with BR. See the "SPOOLCMD" specification in the BRConfig.sys Specification section for additional information. On DOS and NetWork versions, OPENs to PRN: will return error [[6298]] when the following two conditions are true:
:1) SPOOLCMD is not specified
:2) The printer is not ready.


<noinclude>
<noinclude>
[[Category:Config]]
[[Category:Config]]
</noinclude>
</noinclude>

Revision as of 18:51, 31 July 2015

SPOOLCMD is mainly useful for producing print files for Linux and MAC systems. In Windows systems the DIRECT://printer-name is preferred. Also see the PRINTING section.

Basically, SpoolCmd provides a description of how to print data sent to the printer.

Business Rules supports independent spoolers on all systems. The BRConfig.sys SPOOLCMD specification will make a shell call to issue the necessary spool command whenever printing is done. When this is invoked the spooler is responsible for removing the spool file created by Business Rules.

Syntax

SPOOLCMD [SPOOLFILE] [NAME=<name>] [QUEUE] [PRINTER] [COPIES] [WSID] [PROGRAM] [QUEUE] [PRINTER]

The spool command and its parameters can be specified in a CONFIG command or in the BRConfig.sys file as follows:

Business Rules can also make substitutions as follows in parameters specified with SPOOLCMD (they're all optional):

[SPOOLFILE] substitutes the name of the spool file, as determined by Business Rules.

[NAME=] substitutes the name of the printer file as specified in the OPEN display statement's NAME= string. For example, PRN:/10.

[QUEUE] substitutes the queue name as specified in the OPEN display statement. In the following example, "queue" would be substituted for [QUEUE]: PRN:queue/10.

[PRINTER] substitutes the "printerclass" string as specified in the OPEN display statement. For example, PRN:/printerclass.

[COPIES] substitutes the value of the COPIES= parameter as specified in the OPEN display statement.

[WSID] substitutes the user's workstation ID.

[PROGRAM] substitutes the name of the program that is loaded at the time that the printer is closed.

The [QUEUE] and [PRINTER] parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.

NOTE: The spoolfile created by Business Rules will not automatically be deleted.

SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The Windows Client SPOOLCMD syntax is:

  SPOOLCMD [@] [-w] command  parm-1 parm-2 ...

SPOOLCMD honors BR drive substitution on the command itself, for example:

 DRIVE  J:,M:\myapp,j,\
 SPOOLCMD J:\mylib\spooler [SPOOLFILE] [COPIES]

This finds 'spooler' in M:\myapp\mylib.

See also:

Config Spoolcmd

As of 4.3, the CONFIG command supports the SPOOLCMD spec, which enables any system spooler to work with BR. See the "SPOOLCMD" specification in the BRConfig.sys Specification section for additional information. On DOS and NetWork versions, OPENs to PRN: will return error 6298 when the following two conditions are true:

1) SPOOLCMD is not specified
2) The printer is not ready.