LSETUP_DETAILS.TXT for: 15-Nov-2004= Drain-Printer, TOOLS, Capture a print stream into a fileMSee the very lengthy comments at the beginning of the source code for all theKdetails on what this does and how to set it up... an overview follows here.GSince the program itself is named DRAIN, I may use that name instead of"Drain-Printer from time to time...3---------------------------------------------------STEPS TO GET STARTED:B1. Choose a high-numbered port; in this example I will use 9876.32. Choose a local printer name; I will use TEST3.H3. Choose where the output should go; I will use DUA2:[VERNE]TEST.LIS.K4. Optional: Choose a pre-filter DCL cmd file; DUA3:[DRAIN]PRE-FILTER.COMM5. Optional: Choose a post-filter DCL cmd file; DUA3:[DRAIN]POST-FILTER.COMM6. Optional: Choose an OPCOM message class to receive msgs; I'll use OPER5.G (Note: see HELP REQUEST /TO for a list of all the message classes)E (DRAIN reports significant errors to OPCOM using this message class; the default class is CENTRAL)I7. take the EXE file you have created (or use mine) and put it someplace7 accessible; I will use the Multinet: directory. SeeB KIT_CONTENTS.TXT for details on the prebuilt files I've included.3---------------------------------------------------JTypically Multinet server modules run under the username SYSTEM, and DRAINLruns as a detached process (and then dies) whenever a print job comes to it.GSince all the above logicals must be available to DRAIN, the easy place#to put them is in the system table:? DEFINE/SYSTEM MULTINET_DRAIN_9876 DUA2:[VERNE]TEST.LISE DEFINE/SYSTEM MULTINET_DRAIN_CMD1_9876 DUA3:[DRAIN]PRE-FILTER.COMF DEFINE/SYSTEM MULTINET_DRAIN_CMD2_9876 DUA3:[DRAIN]POST-FILTER.COM5 DEFINE/SYSTEM MULTINET_DRAIN_OPC_CLASS_9876 OPER5=Now create the Multinet service and restart the Master ServerG(Note: the name of the service is not important; naturally it must not-conflict with any existing Multinet service): $ MULTINET CONFIGURE/SERVER0 MultiNet Server Configuration Utility V4.3(42)A [Reading in configuration from MULTINET:SERVICES.MASTER_SERVER] SERVER-CONFIG> ADD DRAIN9876: [Adding new configuration entry for service "DRAIN9876"] Protocol: [TCP] TCP TCP Port number: 9876$ Program to run: MULTINET:DRAIN.EXE, [Added service DRAIN9876 to configuration]% [Selected service is now DRAIN9876] SERVER-CONFIG> RESTARTB Configuration modified, do you want to save it first ? [YES] YESR [Writing configuration to MULTINET_COMMON_ROOT:[MULTINET]SERVICES.MASTER_SERVER]= %RUN-S-PROC_ID, identification of created process is xxxxxx SERVER-CONFIG> QUIT<Now create the Multinet print queue and make it operational: $ MULTINET CONFIG/PRINT8 MultiNet Remote Printer Configuration Utility V4.3(25) PRINTER-CONFIG> ADD TEST34 [Adding new configuration entry for queue "TEST3"] Remote Host Name: 127.0.0.1 Protocol Type: [LPD] STREAM TCP Port Number: [23] 9876D [TEST3 => 127.0.0.1, TCP port 9876 (no telnet option negotiation)] PRINTER-CONFIG> EXIT? [Writing configuration to MULTINET:REMOTE-PRINTER-QUEUES.COM]. $ @MULTINET:REMOTE-PRINTER-QUEUES.COM TEST3BOf course see the Multinet documentation for general assistance on>setting up your system to receive inbound LPR jobs and such...*or to restrict who can "print" to you :-)HNow any printouts directed to the queue TEST3 will end up as a text file.called TEST.LIS in the directory DUA2:[VERNE].DTo do fancy stuff, you can use the optional PRE and POST DCL command files... in there use code like: $owner = f$getjpi("","OWNER") $!0 $port = f$trnlnm("MULTINET_DRAIN_P1_''OWNER'") $!0 $size = f$file("MULTINET_DRAIN_''port'","ALQ") $!3 $output_name = f$search("MULTINET_DRAIN_''port'") $!: $tmp_name = f$search("MULTINET_SPOOL:DRAIN_''port'.TMP")<to make decisions on how to proceed or to do special things.HDRAIN will not complain if the PRE or POST DCL routine cannot be locatedFor accessed... DRAIN will process the print job in the default manner.HBoth the PRE and POST DCL routines can pass back a simple flag to DRAIN;Luse $EXIT xxx in DCL to pass back a control value via the $STATUS mechanism:: 1 create filtered file, delete temp file. 9 (8+1) Don't create filtered file* 17 (16+1) Don't delete temp file' 25 (8+16+1) Don't do either oneJIf any value is received other than one of these, DRAIN will do all normalLprocessing as if "1" was received. Naturally when returning from POST the 9Hflag wouldn't make sense since by the time POST is ran the filtered fileLalready exists (and DRAIN will not delete it once it has been created) :-)VerneG-----------------------------------------------------------------------EVerne Britton, Lead Systems Programmer voice: (304) 293-5192 x230GSystems Support Group (in WV, call 1-800-253-1558)@West Virginia Network for FAX: (304) 293-5540: Educational Telecomputing verne@wvnet.eduG837 Chestnut Ridge Road http://vaxa.wvnet.edu/~verneMorgantown, WV 26505