Skip to main content

Problem:

How to print to the Windows printer with a COBOL program that prints to LPT1?

Resolution:

You can always redirect your output to a file and use the call to PC_PRINT_FILE routine to print the file using the Windows printer. This routine prints the contents of the specified file, optionally displaying printer control, font, and progress indicator dialog boxes, before commencing the print.

If however you wish to control each line sent to the printer with different font name, style and size, you will have to change your WRITE statement to a call-by-name routine PC_PRINTER_WRITE. To know more about the printer routines, you can find more details about them from the Net Express online help.

Old KB# 6799