© 1983-2012 Novell. See COPYRIGHT file for details.

Print Services


The print calls outlined in this section allow clients to spool data to the file server for eventual printing on one of the network printers. Clients can retrieve a printer's current job queue and can delete from that queue any of their own jobs. Clients can also query the server for the current status of a network printer.


Close Spool File 0x2222 17 01

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (1) byte 10 AbortQueueFlag byte

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	135	0x87	Create Filename Error
	136	0x88	Invalid File Handle
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	147	0x93	No Read Privileges
	148	0x94	No Write Privileges
	149	0x95	File Detached
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	208	0xD0	Queue Error
	209	0xD1	No Queue
	210	0xD2	No Queue Server
	211	0xD3	No Queue Rights
	212	0xD4	Queue Full
	218	0xDA	Queue Halted
	232	0xE8	Write To Group
	234	0xEA	No Such Member
	235	0xEB	Property Not Set Property
	236	0xEC	No Such Set
	252	0xFC	No Such Object
	253	0xFD	Bad Station Number
	254	0xFE	Directory Locked
	255	0xFF	Bad Printer, Lock Error, Hard Failure, No Files Found

Remarks

This call closes the client's current spool file. If the Abort Queue flag is zero, the spool file is placed at the end of the print queue. If the Abort Queue flag is set, the spool file is not placed in the print queue; instead, the spool file's status flags are examined.

If the spool file is marked for deletion after printing, the file is immediately deleted; if not, the print server closes the spool file and disregards it.

See Also

Set Spool File Flags (0x2222 17 02)


Create Spool File 0x2222 17 09

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (3+FileNameLength) word (Hi-Lo) 9 SubFunctionCode (9) byte 10 DirectoryHandle byte 11 FileNameLength byte 12 FileName byte[FileNameLength]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	132	0x84	No Create Privileges
	135	0x87	Create Filename Error
	141	0x8D	Some Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	148	0x94	No Write Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	File Exists Error, No Files Found, Failure

Remarks

This call allows a client to create and name a print spool and specify its location. The client must have create and write privileges in the specified directory.

This call is provided by the print server as a service to the client. If the client spools data to the print server without first opening a spool file, the print server automatically creates a spool file for the client in the print server's work directory. Because spool files created by the print server are not directly available to all clients, the print server allows a client to specify a location for the spool file. In this way, the client can keep the spool file for future use after the print server has filled it with spooled data.

See Also

Write To Spool File (0x2222 17 00)


Get Printer's Queue 0x2222 17 10

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (10) byte 10 PrinterNumber byte

Reply Format

Offset Content Type (reply header) 8 ObjectID long

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	255	0xFF	Bad Printer

Remarks

This call returns the Object ID of the queue servicing the specified printer.

See Also

Write To Spool File (0x2222 17 00)


Get Printer Status 0x2222 17 06

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (6) byte 10 TargetPrinter byte

Reply Format

Offset Content Type (reply header) 8 PrinterHalted byte 9 PrinterOffLine byte 10 CurrentFormType byte 11 RedirectedPrinter byte

Completion Code

  0	0x00	Successful
150	0x96	Server Out Of Memory
255	0xFF	Bad Printer
251	0xFB	Bad Dir Handle
253	0xFD	Bad Station Number

Remarks

This call allows a client to check the status of a shared printer.

Printer Halted will be 0xFF if the printer has been halted from the system console; otherwise it will be 0.

Printer Off Line will be 0xFF if the printer is off-line; otherwise it will be 0.

Current Form Type will contain the number of the form currently mounted on the printer.

Redirected Printer will contain the number of the printer that jobs destined for Target Printer are being sent to. Redirected Printer will usually be the same as the Target Printer specified by the client. If Redirected Printer and Target Printer are not the same, the target printer has been redirected from the system console, and jobs sent to it are automatically rerouted and placed in a print queue of the printer indicated by Redirected Printer.

This NCP works only on a 286 server (v2.15 and previous) when a printer is configured into the system with the NETGEN utility. The "P" command at the console must respond with a list of printers for this NCP to work.


Set Spool File Flags 0x2222 17 02

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (21) word (Hi-Lo) 9 SubFunctionCode (2) byte 10 PrintFlags byte 11 TabSize byte 12 TargetPrinter byte 13 Copies byte 14 FormType byte 15 Reserved byte 16 BannerName byte[14]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	210	0xD2	No Queue Server
	211	0xD3	No Queue Rights
	232	0xE8	Write To Group
	234	0xEA	No Such Member
	235	0xEB	Property Not Set Property
	236	0xEC	No Such Set
	252	0xFC	No Such Object
	254	0xFE	Directory Locked
	255	0xFF	Failure, Bad Printer

Remarks

This call allows a client to set the print environment for a print job. When the print server adds a job to the print queue, it records the client's current print parameters and later uses them to control the printing of the job.

Print Flags is a bit field. The bits have the following meaning when set:

BitBit Definition
3Form feeds should be suppressed (not sent) at the end of the job
5The spool file should be deleted after printing
6The print server should expand tabs in the file
7A banner page should be printed

Tab Size has meaning only if bit 6 is set in Print Flags. If bit 6 is set, the print server assumes that the file being printed is a standard ASCII file. The print server will assume tab stops exist in every column that is a multiple of Tab Size; any tabs that are encountered while printing the file will be replaced by enough spaces to move the printer over to the next tab stop column. If tabs are being expanded by the print server, the print server will interpret any Control Z character (0x1A) encountered in the print file as an end-of-file mark and will stop printing the file.

If the tab expansion bit (bit 6) is cleared in Print Flags, the printer makes no assumptions about the nature of the file it is printing or the nature of the device the file is being sent to. If bit 6 is cleared, the print server can drive many different types of devices (printers, plotters, and so on), but the burden of appropriately controlling these devices is on the client using the device.

Target Printer indicates which of the print server's printers the data file should be queued to. Printer numbers start at printer 0.

Copies indicates the number of times the spool file should be sent to the printer.

Form Type indicates the form number the client wants the job to be printed on.

Banner Name indicates the filename the client wants to appear on the print banner page. This field should be null-padded if the desired name is less than 14 characters long.

After each job is added to the queue, the print server resets the print parameters to default values. The default values are as follows:

See Also

Close Spool File (0x2222 17 01)

Write To Spool File (0x2222 17 00)

Get Printer's Queue (0x2222 17 10)


Spool A Disk File 0x2222 17 03

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (3+FileNameLength) word (Hi-Lo) 9 SubFunctionCode (3) byte 10 DirectoryHandle byte 11 FileNameLength byte 12 FileName byte[FileNameLength]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	135	0x87	Create Filename Error
	136	0x88	Invalid File Handle
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	147	0x93	No Read Privileges
	148	0x94	No Write Privileges
	149	0x95	File Detached
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	208	0xD0	Queue Error
	209	0xD1	No Queue
	210	0xD2	No Queue Server
	211	0xD3	No Queue Rights
	212	0xD4	Queue Full
	218	0xDA	Queue Halted
	232	0xE8	Write To Group
	234	0xEA	No Such Member
	235	0xEB	Property Not Set Property
	236	0xEC	No Such Set
	252	0xFC	No Such Object
	254	0xFE	Directory Locked
	255	0xFF	No Files Found, Lock Error, Bad Printer, Hard Failure

Remarks

This call allows a client to send an existing file to a print queue so the client does not need to recopy the file into a separate spool file. The server uses the client's current print parameters and adds the file to the job queue of the appropriate printer.

Clients must have open and read privileges for any files they spool.


Write To Spool File 0x2222 17 00

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (17) byte 7 SubFuncStrucLen (2+DataLength) word (Hi-Lo) 9 SubFunctionCode (0) byte 10 DataLength byte 11 Data byte[DataLength]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	1	0x01	Out Of Disk Space
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	135	0x87	Create Filename Error
	136	0x88	Invalid File Handle
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	148	0x94	No Write Privileges
	149	0x95	File Detached
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	161	0xA1	Directory I/O Error
	162	0xA2	I/O Lock Error
	255	0xFF	Failure, No Files Found

Remarks

This call appends the specified data to the end of the client's current spool file. If the client does not have a current spool file, the print server creates the file in its work area and writes the data to it. The print server makes no assumptions about the format or contents that it writes to a spool file; the client must create a data stream that produces the desired output when it is sent to the target printer.

See Also

Create Spool File (0x2222 17 09)

Close Spool File (0x2222 17 01)

Get Printer's Queue (0x2222 17 10)