Print to File captures output from an emulated serial port and writes each completed print job to a text file on the Windows host. Each configured Print to File session requires 10 license units.
In the Avanti Configuration Utility, open the OPA0/tty00 or TTA0/tty01 tab and select Print to file. Specify the following values. The adjacent [+] dialog exposes the same three properties; it does not add further Print to File settings.
Directory
The required existing host directory in which completed print jobs are written. Select a fully specified path; relative paths such as . are not accepted. The emulator process, including a service account when applicable, must have permission to create and replace files in this directory.
Naming rules
An optional text file that derives an output filename from the print data. Leave this field empty to name jobs from the local completion time. An unreadable or invalid rule file prevents the emulator from accepting the configuration.
End job after
The period of serial-port inactivity that ends a print job, in milliseconds. The valid range is 100 through 3,600,000 ms; the default is 500 ms. Enter decimal digits, or use decimal K and M suffixes; for example, 1K is 1,000 ms. Choose a value longer than ordinary pauses within one job. Before stopping Avanti, allow the configured interval to pass so the last job can be written.
Output behavior
Carriage returns and lone line feeds are written as Windows CR/LF line endings. A form feed is represented by three CR/LF sequences. Avanti keeps at most 1 MiB in its private active-job buffer and spools longer jobs to a temporary host file. The temporary file is removed when the job completes or the session closes. The job remains one output file, and naming rules can search its complete contents. Ensure the Windows temporary-file location has enough free space for long jobs. When the inactivity interval expires, Avanti writes the job. Without a naming-rule file, or when a configured rule file does not select a filename, the default filename is YYYYMMDD HHMMSSmmm.txt, where mmm is the completion time in milliseconds. If that automatic name already exists, Avanti appends -1, -2, and so on, and creates the first available name atomically. A rule-derived filename replaces an existing file with the same name, so rules should include fields that make each job name unique. If a rule produces an invalid filename, Avanti records a warning and writes that job under a collision-safe default filename instead.
If a file cannot be opened, written, flushed, or closed, Avanti records a CPF-E-OUTPUT message, retains accepted print data and the selected filename, and retries after five seconds. Correct directory, permission, free-space, or filename problems before the retry. If temporary spooling fails and the 1 MiB memory limit is reached, Avanti records CPF-E-SPOOL and discards further input until spooling succeeds or the job completes; check free space and permissions at the Windows temporary-file location. Invalid rules report CPF-F-RULE; an unreadable rule file reports CPF-F-RULEFILE.
Naming-rule syntax
Blank lines and lines whose first non-space character is a semicolon are ignored. Use one TAB character per nesting level; spaces do not define nesting. Rule names and options are not case-sensitive. Quoted text may contain spaces.
•if "text" runs its child rules only when the print data contains the text. Searches begin at the matched text.
•set N "text" assigns literal text to field N.
•find N "text" finds text and assigns the following field to N. Add skip N to skip fields, down N to move down lines, or fields N to capture multiple whitespace-separated fields.
•find N "text" vmsdate reads a VMS date and time whose day has one or two digits, such as 2-APR-2025 18:51:20 or 12-APR-2025 18:51:20, and reformats it as YYYYMMDD HHMMSS.
•filename "template" selects the output filename and finishes rule processing. Insert field N with %N%, or right-pad its output field with spaces to a minimum width with %N:width%. Every referenced field must have been set. The result must be one ASCII Windows filename of at most 255 characters, not a path: directory separators, drive prefixes, relative-directory components, alternate data streams, control characters, non-ASCII bytes, reserved DOS device names, and other Windows-invalid filename characters are rejected so output remains in the configured directory.
The following rule names a job from the first word after User: and otherwise uses a fixed fallback. The two indented lines must begin with one TAB character.
if "User:"
find 1 "User:"
filename "print-%1%.txt"
filename "print-unknown.txt"