Miraplacid Home Contact UsStoreDownloadsMiraplacid NewsMiraplacid ForumSearch at Miraplacid.com
Miraplacid Publisher (Image Printer Driver)Miraplacid Text Driver (Text Printer Driver)Miraplacid Scripting ComponentsMiraplacid Form
Bookmark this pageMiraplacid PublisherMiraplacid Text DriverMiraplacid FormMiraplacid Scripting ComponentsMiraplacid Company

Miraplacid Text Driver Howto

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:
  1. Share Text Driver on the network.
  2. On PC with your DOS program, create the following batch file:
    
    net use lpt1: /delete 
    net use lpt1: \\Your_Computer_Name\SharedPrinter 
    
  3. Run this batch file.
  4. Open Advanced Settings software.
  5. Set Datatype to TEXT and press OK.
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 print to Text Driver from service or other program when nobody is logged in?


Normally, Text Driver core works under Interactive User, using the same account and in the same session as user printing application. This allows Text Driver to support correctly such personal folders like Profile, Desktop, My Documents, etc.
But, when nobody is logged in, Windows does not allow COM applications to run if they are set up to be working under Interactive User account. In this case, even setting AutoSave to "ON" will not help because the core will not be started.
To run Text Driver successfully in such a "server" environment, you need to:
  1. Launch Text Driver user interface from your desktop or program folder.
  2. Set all Text Driver options to desired values. Please, do not use personal folders in {{SYSFOLDER}} tag.
  3. Set AutoSave checkbox to "ON" in System Options.
  4. Click to "Administer" button in the same tab.
  5. In Administration software, change RunAs option to System Account. Press Ok.
  6. Close user interface. The configuration will be saved.
In result, Text Driver will work in automatic mode, without user interface and under System account.
If you will need to change configuration, just open user interface, make your changes and close it.

3. How to set up Text Driver to work as a network printer?


As any other printer, Text Driver may be shared on a network by setting standard sharing properties in Printers/Printers and Faxes folder. You may install Text Driver on your network server, share it and choose any suitable name for this shared printer.
But, you will not be able to use Text Driver interactively, i.e., with User Interface. By default, User Interface will pop-up on the server. So, before you will start using Text Driver as a shared printer, you will need to change and save all necessary settings, and set AutoSave mode to ON to prevent User Interface component to start.
However, you will not be able to use personal settings for this printer users - no personal folders, {{USER}} tags, etc, because Text Driver core will run under the same account for all users. Additionally, if you use server without logged in users, you may need to perform steps from previous recipe (2).
If you need to have personalized settings, or need to launch User Interface for your users, we recommend you to consider Terminal Server Edition.

4. 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);

5. 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);
Copyright © 2001 - 2010 by Miraplacid.  Legal Notices