Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> printer functions overview</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Printer functions overview
------------------------------------------------------------------------------
 Capturing Data

 The NOVLIB print function calls are designed to move printer output from a
 workstation to a file server. Using these functions, your program can send
 data to a file server for storage or printing and transfer specifications
 for the way in which data should be printed, such as information about
 formatting, banner page specifications, number of copies to be printed,
 etc. The capture and rerouting of local LPT devices (devices connected to
 the parallel printer port) forms the basis of the print functions.

 How a Capture Works

 A capture is the interception of data that a workstation has sent to its
 local LPT device. NetWare performs captures through the workstation shell
 by replacing the service routine for DOS interrupt 17 with the shell's own
 service routine. By controlling this interrupt, the shell can intercept
 data being sent to an LPT device and redirect it to a file server.
 When the file server receives the captured data, it puts the data in a
 capture file created for that particular workstation. Your program can
 specify whether the capture file should be a permanent file on the file
 server, or a temporary job file that will be queued for printing.

 Using NOVLIB Functions to Control a Capture

 NOVLIB offers many functions for controlling print captures. Fortunately,
 only a very few are required for a successful print capture setup. The
 required functions are, in the order in which they should be called:

 .  CapEnd(), to release any existing capture and clear any old and
 potentially unwanted settings.
 .  CapQueueSet(), to declare to NetWare which print queue is the
 destination for printed data.
 .  CapStart(), to initiate the capturing process and "open the door"
 for data to flow into a new print job.

 Most of NOVLIB's other capture-related functions deal with specific aspects
 of the capturing process, or formatting and handling of print jobs, and can
 be used or omitted as necessary.

 Managing a Capture

 To perform a capture your program must complete the following steps:

 .  Begin the capture.
 .  Write to the captured LPT device.
 .  Flush or end the capture.

 These steps can be accomplished in a single program, or you can separate
 them into several programs.
 The NetWare utilities CAPTURE and ENDCAP are an example of how the steps
 can be separated: CAPTURE initiates the capture of the default LPT device
 and ENDCAP terminates the capture. While the capture is active, any print
 program can be used to send data to the captured LPT device.
 If your program will handle the actual printing of the data, you will
 probably want to perform the entire capture within one program. You may
 want to consider using the NOVLIB queue functions for this type of printing
 service. In addition to flushing or ending a capture, you may also cancel
 it. Flushing, ending or cancelling a capture have the following effects:

 Flushing a capture closes the current capture file. If the file server was
 queuing the data for printing, the job is released to the print queue. If
 the data was being sent to a permanent file, the file is closed. The
 capture itself remains active after the flush, and the file server opens a
 new capture file to receive additional data as soon as the next character
 is sent by the program.
 Ending a capture closes the capture file and restores the operation of the
 local LPT device. If the file server was queuing the data for printing, the
 job is released to the print queue. If the data was being sent to a
 permanent file, that file is closed.
 Cancelling a capture restores the operation of the LPT devices of the
 workstation. If the file server was queuing the data for printing, the
 cancellation removes the data from the queue and deletes the job file from
 the file server. If the data was being sent to a permanent file, the file
 is not deleted, but just closed.

 If your program opens a permanent capture file, you should close the file
 by ending the capture before opening another permanent capture file on that
 file server. However, if you are providing access to multiple file servers,
 you may open a permanent capture file on each file server to which the
 station is attached. In contrast, if your program is capturing to a
 temporary job file that will be queued for printing, three files may be
 opened at once (one for each LPT device). For example, a workstation could
 have LPT1: directed to PRINTQ_1, LPT2: directed to PRINTQ_2 and LPT3:
 directed to a permanent file all on the same file server. Data sent to
 LPT1: would be placed in a temporary file marked for PRINTQ_1. Similarly,
 data sent to PRINTQ_2 would be placed in another temporary file. Data sent
 to LPT3: would be stored in the permanent file and could be printed
 whenever it was convenient.

 Capturing an LPT device is a simple way for programs to provide printing
 capabilities on the network through the server. During a capture, any data
 sent to the captured LPT device is redirected to either a permanent file or
 is queued for printing. A capture provides the added convenience of a
 default print configuration for each LPT device.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson