1. How to print to Text Driver from DOS program?
To set up Miraplacid Text Driver to catch DOS text print job, you need to do the following:
- Share Text Driver on the network.
- On PC with your DOS program, create the following batch file:
net use lpt1: /delete
net use lpt1: \\Your_Computer_Name\SharedPrinter
- Run this batch file.
- Open Text Driver properties (in Printers folder).
- Click on "Advanced" tab and press to "Print processor..."
- "MTD_PRINT" print processor should be selected in the left column.
- Choose "Text" as default datatype for MIRAPRINT and press "Ok".
- Close Miraplacid Text Driver properties.
You should be able to print from a DOS program to LPT1. Try it out from EDIT, open a text file, and print it.
2. How to send extracted text by email with Outlook?
You may use the following script file as a post-processor:
==================== outlook.js =================
var objArgs = WScript.Arguments;
if(objArgs.Count()<1) {
WScript.Quit(1);
}
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1);
var mtdtext=text.ReadAll();
var ol = WScript.CreateObject("Outlook.Application");
var msg = ol.CreateItem(0);
msg.Recipients.Add("user@company.com");
var success = msg.Recipients.ResolveAll();
msg.Subject = "New text from MTD";
msg.Body = mtdtext;
if(success) {
msg.Send();
} else {
msg.Display();
}
===================================================
Check "Open with" checkbox in File transport properties. Fill out "Open with" editbox with
cscript.exe. In "Parameters" type outlook.js (with a full path to it).
Text printed by MTD must be in ANSI. If you need to open Unicode files,
change
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1);
to
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1, false, true);
3. How to send extracted text by email with Collaboration Data Objects (CDO) messaging component (CDONTS.NewMail) ?
You may use the following script file as a post-processor:
==================== cdonts.js =================
var objArgs = WScript.Arguments;
if(objArgs.Count()<1) {
WScript.Quit(1);
}
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1);
var mtdtext=text.ReadAll();
var mail = WScript.CreateObject("CDONTS.NewMail");
mail.From="user1@company.com";
mail.To="user2@company.com";
mail.Subject="New text from MTD";
mail.Body=mtdtext;
mail.Send();
================================================
Check "Open with" checkbox in File transport properties. Fill out "Open with" editbox with
cscript.exe. In "Parameters" type cdonts.js (with a full path to it).
Text printed by MTD must be in ANSI. If you need to open Unicode files,
change
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1);
to
var text = fso.OpenTextFile(fso.GetAbsolutePathName(objArgs.Item(0)), 1, false, true);