The AutoPrint Service is a system for printing files to a Virtual Printer on an MCP system and having them processed on a Windows system.
The processing on the Windows system is done by a VBScript, which is provided with information about the WFL Job doing the Printing, as well as access to the attributes of the Print Job.
When CopyWrite is installed on the Windows system, the AutoPrint Service (AutoPrint.exe) and a VBScript (AutoPrint.vbs) are installed.
To use the AutoPrint Service as installed, a Virtual Printer must be configured on the MCP Host, with a SCRIPT=AUTOPRINT parameter, as described below.
The installed VBScript (AutoPrint.vbs) converts the files from MCP BACKUPPRINTER format to Windows .txt format.
This VBScript can be modified to perform any site specific processing, such as sending E-Mail or doing a Word Processing Mail Merge.
A Virtual Printer on the MCP must be configured so that a WFL Job or some other Task can issue Print Requests.
The PS CONFIGURE command may be used to configure a Virtual Printer. See the Print System and Remote Print System Administration, Operations, and Programming Guide for a complete description.
The Virtual Printer is a procedure provided by SL COPYWRITE and is called REMOTEPRINTSERVER. It is configured with a (<parameter string>) which defines the parameters that specify how and where the files will be processed.
This example shows a Virtual Printer called CPNTA being configured.
PS CONFIGURE CPNTA
SERVER = "REMOTEPRINTSERVER (DESTINATION='SITE', SCRIPT=AUTOPRINT,
TYPE=CD,
HOSTNAME=CPNTA,
PATH=*ASERIESPRINT ON C)
IN SL COPYWRITE"
These are the parameters which may be specified in the (<parameter string>).
Attribute | Value | Comment |
---|---|---|
Destination | '<string>' | This is provided to the Script as the Destination attribute of the Script Object |
HostName | <name> | The
HostName of the remote Windows system on which the AutoPrint service is
installed.
The HOSTNAME attribute of the TCP/IP Port File is set to this value. |
Path | <mcp filetitle> | This
is the Directory on the Windows system within which the Print Files will
be stored.
In the example above, *ASERIESPRINT ON C corresponds to the Windows directory C:\ASERIESPRINT. |
Script | <name> | This
is the simple name of the Script which will be invoked on the Windows
system.
Currently, this name has '.vbs' appended, and the file must be located in the same directory as the AutoPrint.exe service (usually C:\Program Files\Metalogic\CopyWrite). |
Type | CD
| WRAP |
This
defines the type of container into which the native MCP Print Files are stored
on the Windows system.
CD is a Library/Maintenance CD Image. WRAP is an MCP Wrapped Container. |
A copy of the REMOTEPRINTSERVER is initiated by the Print System when a Print Request is received for the Virtual Printer.
A Print Request may consist of multiple Print Files.
The REMOTEPRINTSERVER maintains a list of the files belonging to the Print Request, and when notified by the Print System that the request is completed, it connects to the AutoPrint service at the remote Windows system.
The list of filenames which will be copied is sent, then the files are copied into a container (CD or Wrapped) at the Windows system and when the copy has completed, the VBScript is executed.
The container is copied into a multi level directory specifed by the Path parameter configured for the Virtual Printer (*ASERIESPRINT ON C), the Current Date(15Jul2005) and the USERCODE (NFT) of the Print Request, as shown below.
This VBScript converts the files in the container (767_775.mcp) into individual .txt files.
' ***** Select the A-Series Disk Volume *****
Spout("There are " & Selector.FileCount & " Files in the Container")
Spout("Container is " & Script.ImageName)
Spout("Tr_Note is " & Info.Tr_Note)
' ***** Convert the Print Files *****
For Each File In Selector
Spout(File.FileName)
FileName=Script.ImagePath & "\" & File.FlatName & ".txt"
Spout(FileName)
If Not Selector.ConvertToText(File.FileNo,FileName,TRUE,Reason) then
Spout(Reason)
End If
Next
This VBScript is called AutoPrint.vbs, and is installed in the same directory as the CopyWrite AutoPrint.exe service, usually C:\Program Files \Metalogic\CopyWrite.
This is an example of the ODT messages displayed when printing a file using AutoPrint.vbs.
---Mix-Time--------------------- 21 MESSAGES --------------------------
* 1157 12:19 DISPLAY:EOT C:\Program Files\Metalogic\CopyWrite\
AUTOPRINT.vbs.
* 1157 12:19 DISPLAY:Cancelling (NFT)AT/CPNTA/PRINT.
* 1157 12:19 DISPLAY:C:\ASERIESPRINT\18Jul2005\NFT\bd_0001150_0001169_
000000000000_outfile.txt.
* 1157 12:19 DISPLAY:*BD/0001150/0001169/000000000000/OUTFILE.
* 1157 12:19 DISPLAY:Tr_Note is "WRITE J:NOTE=<text>".
* 1157 12:19 DISPLAY:Container is C:\ASERIESPRINT\18Jul2005\NFT\
1150_1169.mcp.
* 1157 12:19 DISPLAY:There are 2 Files in the Container.
* 1157 12:19 DISPLAY:Executing VBScript in C:\Program Files\Metalogic\
CopyWrite AUTOPRINT.vbs with Image C:\ASERIESPRINT\
18Jul2005\ NFT\1150_1169.mcp.
* 1176 12:19 <1> *BD/0001150/0001169/000000000000/OUTFILE
copied to C at INSPIRON
* 1176 12:19 Metalogic CopyWrite Version 51.510.02 was compiled
at 16:55:29 on the 23rd April 2005 (MCP 48.189.9445)
* 1157 12:19 DISPLAY:CPNTA *BD/0001150/0001169/000000000000/OUTFILE
ON DISK printed.
The VBScript in the previous example uses the 3 intrinsic objects, Selector, Script and Info, which are created by the AutoPrint Service and provided to the VBScript.
If there are no attribute or method name conflicts, then the Object Name does not need to be used as a qualifier. For example, Display(Tr_Note) is the same as Display(Info.Tr_Note).
The Selector Object is an instance of the SelectorX Object, the attributes and methods of which are described in the Section on the CopyWriteInterface ActiveX Objects.
The Info Object is an instance of the PrintInfoX Object, the attributes and methods of which are described in the Section on the CopyWriteInterface ActiveX Objects.
The Script Object provides these methods.
Methods | ||
---|---|---|
Method | Description | Example |
PROCEDURE Spout(Const Text:String) |
The Text is displayed on the originating station. | Spout("Note is " & Info.Tr_Note") |
The Script Object provides these Properties.
Properties | ||
---|---|---|
Property | Description | Example |
HostName:String; | The HostName of the MCP Host which initiated the Print Request..> | Spout("HostName is " & HostName) |
Destination:String; | The Destination parameter configured on the MCP Virtual Printer. | Spout("Destination is " & Destination) |
ScriptName:String; | The Script parameter configured on the MCP Virtual Printer. | Spout("ScriptName is " & ScriptName) |
ImageName:String; | The Windows Filename (Volume, Directory and FileID) of the Container (CD or Wrapped) which contains the Files for the Print Request. | Spout("ImageName is " & ImageName) |
OriginHostName:String; | The HostName of the MCP Host which established the TCP/IP Connection to the AutoPrint Service. | HostName is " & OriginHostName) |
OriginUserCode:String; | The UserCode of the Task which established the TCP/IP Connection to the AutoPrint Service. | Spout("Origin Usercode is " & OriginUserCode) |
ImagePath:String; | The Windows Path (Volume & Directory) where the Container was created. | Spout("ImagePath is " & ImagePath) |
Important Note: This software should only be used in a trusted domain. CopyWrite does not dictate any policy about where files are copied on the Windows NT system. If the RU allows a remote user access, then the files may be created anywhere. CopyWrite is running as a privileged process on the Windows NT system.