PMLPR Documentation =================== Introduction ------------ PMLPR is a Windows Print Manager to LPD protocol conversion program. Its purpose is to allow print streams produced by normal Windows applications to be diverted to a UNIX style print queue adhering to the LPD protocol. To perform the TCP/IP communications required, the PC must have some kind of network access card (eg, an ethernet or token ring card) and be running a WINSOCK compliant TCP/IP stack. Up to 10 remote print queues can be defined. Each of these would normally be associated with a different logical Windows Print Manager print queue. Selection of which queue a print job goes to can be made in most Windows applications by using the "Print Setup" dialog. Printing from DOS applications is also supported. PMLPR will not interfere with printing to any "real" printing device attached to the PC (through a COM or LPT port). Basic Architecture ------------------ The Windows Print Manager normally disposes of print jobs to a real printing device, such as a printer attached to LPT1. It is also possible to get the print manager to send a print job to a file. A third (and subtlely different) possibility is to get the print manager to direct the output to a windows "PORT" which just happens to be a file. "PORT"s are defined in the WINDOWS\WIN.INI file, in the "Ports" Section. When the Windows Print Manager Queue generates output, it sends a message to each Windows application, so that any application interested in such an event can take some action. Now, PMLPR listens for such messages. When it gets one of these "spool status" messages, it checks all the PORT files is knows about to see if Windows has written a new file to one or more of them. If it finds a new file, it copies it to a safe place (to save it from being overwritten by another print job), and then arranges for it to be printed to a UNIX print queue. Each UNIX print queue defined to PMLPR has 3 vital pieces of information: - the name of the PORT file that Windows will put print jobs into - the name of the LPD Host to send the print to - the name of the LPD queue on this host which will process the print job Using PMLPR from DOS -------------------- PMLPR is a Windows application, but it can be used to process print requests generated in DOS boxes. An optional parameter "DosTimer", which can be set during installation or later from the PMLPR Configuration Option defines a timer interval used by PMLPR to scan the port files for new print jobs. This scanning technique is not necessary if you are only printing from Windows Applications, because the Windows Print Manager notifies PMLPR when a new print is ready to be processed. To print from a DOS application, redirect the application output to one of the PORT files associated with a PMLPR print queue (it is probably better to not have this PORT file associated with a Windows Print Queue, as I dont know what happens if a DOS application and the Print Manager try to write to the same file at the same time, but it is very likely that something would go wrong). What time interval should be used for DosTimer? Setting it too low will waste CPU cycles, setting it too high may mean that 2 prints are generated in the interval between scans, resulting in one print file being lost! Try a value of 10 (ie, 10 seconds) unless you have a definate reason for some other value. Installation ------------ PMLPR is distributed as a zip file, which first must be unzipped to a floppy. Then, from Program Manager, run "A:\SETUP". The most important question you will be asked during installation is to nominate the spool directory name. This directory holds all the PORT files, and all the temporary spool files generated by PMLPR. PMLPR Print Queues ------------------ Up to 10 print queues can be defined. The print queue parameters are: - the name of the PORT file that Windows will put print jobs into - the name of the LPD Host to send the print to - the name of the LPD queue on this host which will process the print job - the LPD print format, which tells the remote LPD process how to interpret the data in the print stream - banner information Most LPD processes restrict access to their printing facilities to certain defined hosts. On a typical UNIX system, the names of hosts which are allowed to send print requests are defined in the "/etc/hosts.lpd" file. The entries in this file are normally the names of hosts as returned by a reverse-name lookup on the IP address of the sending host. Contact your system administrator to get your PC defined to your target LPD hosts. Once setup, PMLPR queues can be suspended, restarted, deleted and have all their attributes changes. Queued, suspended or failed files can be deleted, viewed or moved to another queue. When a print request fails, it's associated print queue is suspended. Although print requests will continue to be processed by other print queues, all further print requests to the suspended queue are held, awaiting for your "user intervention" to restart the queue. PMLPR keeps a history of how many attempts have been made to print a file, and of the most recent error information associated with a print failure. The status of a remote print queue can be listed, which shows how many print jobs are remotely queued. This status cannot be obtained whilst a job is printing. PMLPR can only print one job at a time. Licensing --------- PMLPR may be used by anyone for any purposes, except that it may not be sold. Complete source code is available by sending email to commprog@its.csiro.au (a donation towards the research work of CSIRO is requested to obtain the source code). PMLPR is made available without any guarantees and without support (except internally at CSIRO) - use at your own risk. Acknowledgements ---------------- Peter Tattam, for the wonderful TRUMPET shareware WINSOCK. Thomas Heil, for the WLPRSPL program which demonstrated the basic technique of trapping the Windows Print Manager Spooler status message. All the developers of the WINSOCK specification Release History --------------- 0.10 27 Oct 93 0.11 28 Oct 93 - fix grid empty bug - allow dos time check of > 32 secs (int overflow problem) 0.14 1 Nov 93 - unlink files to delete them on remote host after printing - remove system ctl box to prevent exiting from there which can leave "phantom" copies of pmlpr hanging around (VB feature?) 0.15 3 Nov 93 - change shutdone and socket number use logic 0.16 5 Nov 93 - dont remember iconized window dimensions 0.17 17 Nov 93 - screen position values should be "long" - always leave "cancel" button enabled, just in case we lose the plot 0.18 13 Dec 93 - cant remember 0.21 17 Mar 94 - send data file first, reorder control file elements, minor cosmetic changes 0.22 15 Apr 94 - fix bugs in fiddling with entries when other entries have been deleted - support resizing on main form and grid 27 October 1993 Kent Fitch ITSB CSIRO Canberra Australia kent.fitch@its.csiro.au