PTC MKS Toolkit Knowledge Base

Section:IO
Product:MKS Toolkit (TKPDev/TKEDev)
Version:
OS:All
Keywords:lpr, printing
Category:Porting/Knowledge Base


My program pipes to lpr for printing. What can I do?


Windows NT-based operating systems have a TCP printing service (Windows 9x/Me does not). Once installed (Control Panel/Networks/Services/Add), a command line-based lpr.exe is located in %SystemRoot%\system32. Unfortunately this utility does not accept stdin for the printer data, so your application must be modified to output the formatted printer data to a file and then ask lp to send it to a tcp printing service on some server.

MKS Toolkit porting products do provide /dev/lp which interfaces to the default printer. And, you can send data directly to a network printer with open("//<server>/<printer>").