Printing to the default Windows printer



For some reports, it may be desirable simply to print to the default printer using the default font.


Getting Started with ACUCOBOL-GT

Version 8.0

Chapter 2: Windows Installation > 2.5 Printing and Spooler Issues > 2.5.1 Spooler Formatting > -P SPOOLER

If it is desirable to utilize the default printer and font, simply assign the print file to "-P SPOOLER". For example, to assign "PRINTER1" to the spooler, enter the following line in the COBOL configuration file ("CBLCONFI"):


By default, the runtime system assigns the "PRINTER" device to the spooler. This may be changed in the configuration file by assigning "PRINTER" to some other name.

When the runtime opens a file assigned to "-P SPOOLER", it automatically initiates a job with the Windows spooler and constructs print pages in accordance with the program. The runtime uses the default printer and font. If the user looks for the job in the spooler, it is named with the current title of the ACUCOBOL-GT window.


Note: The Windows spooler operates by drawing the report on each page. It constructs its own control codes to handle formatting. If the print file is assigned to "-P SPOOLER" and the file contains device-dependent control sequences (such as those used to shift to a condensed font, or to print a form and then fill it in), the codes will be passed to the spooler as data and thus will not be interpreted correctly. If there are reports that depend on embedded control codes, print those directly to the device, or assign the print file to "-P SPOOLER-DIRECT".


Old KB# 2672
Comment List