Dec 232017
 
Redirects printer output to a file. Execellent.
File REPRINT.ZIP from The Programmer’s Corner in
Category Printer Utilities
Redirects printer output to a file. Execellent.
File Name File Size Zip Size Zip Type
REPRINT.COM 2919 1911 deflated
REPRINT.DOC 11690 4262 deflated

Download File REPRINT.ZIP Here

Contents of the REPRINT.DOC file




REPRINT Version 1.2

(c) 1986 William C. Parke
1820 S Street NW
Washington, D.C. 20009

DISTRIBUTION

REPRINT Version 1.2 may be freely copied and distributed as long
as the only charge is for media and reproduction costs. Under no
circumstances should the program be distributed with a commercial
product, sold for profit, or distributed in modified form without
express permission of the author.


INTRODUCTION

REPRINT is a generic PC-DOS resident utility which redirects
output intended for a parallel printer to a disk file. It should
work on any IBM PC Compatible machine.

[See the end of this text for changes in REPRINT Version 1.2 from
Version 1.1.]

The following are among the purposes of REPRINT:

(1) By sending output intended for a printer from a word
processor or other printing program to a disk file, that print
file can be used to print the same document again at a later
date, without reloading the word processor and reformating the
document.

(2) Word processors can produce a set of print files which can be
queued up into a master print file for later printing.

(3) Files ready to be printed can be created in one location,
transmitted to a remote site over standard telephone lines, and
then printed at the destination, without need for the parent
program at the remote site.

(4) Some word processors and printing programs do not allow the
user to see the exact character strings being sent to a printer.
By redirecting output to a print file, the user can examine the
detailed structure of the printer control strings, checking to
see if they match the characteristics of intended printer.

(5) REPRINT can be used to save a file copy of screen activity
while using the MS-DOS command processor, and to save the screen
within any program which uses the standard output device for
console display.

REPRINT COMMAND SYNTAX


To start printer redirection, use the command:

REPRINT [filename] /S [/BB]

The bracketed characters above indicate an optional feature. The
'filename' is an optional disk file name. If no name is
supplied, the default name REPRINT.LPT will be used for the
printer file.

The /S represents a switch to determine where printer output is
to be redirected. The table below gives the three possible
switch characters and their function:

S | Send LPTn: characters to:
-------+----------------------------
f | a file
p | the printer
n | a null device

Printer redirection can be started by giving one of the three
switch characters on the command line, giving a print file name,
or specifying a buffer size. If an incorrect switch appears,
REPRINT displays help screen.


Use the /F option to start print redirection to the default print
file when REPRINT is not yet resident, or to re-establish the
current print redirection to the current print file when REPRINT
is resident, and to flush the remaining print buffer characters
to the print file.

Use the /P option to establish REPRINT redirection to the line
printer. If REPRINT is already resident, this option will also
flush the print memory buffer to the current print file.

The null device option is used to stop print redirection and
flush the print buffer in memory to the print file. It will be
set automatically if redirection to file is attempted from the
MS-DOS COPY command and the memory buffer is not large enough to
hold all of the output sent to the printer device.

The /BB is an optional memory buffer size indication. If no size
is given, the default size of 8K will be used. Sizes range from
1 to 48K. Memory size can only be set when starting REPRINT for
the first time. Once REPRINT is resident, its memory buffer size
is fixed.

GETTING THE REPRINT HELP SCREEN

To see a summary of the REPRINT command options, use:

REPRINT /

INVOKING REPRINT

In a typical application, suppose you which to capture the output
from word processor to your printer.

First, start REPRINT from the MS-DOS prompt:

>REPRINT /F

REPRINT will be installed in memory with redirection to the
default file REPRINT.LPT taken from any one of the printers
LPT1:, LPT2:, LPT3:, or LPT4:.

Next, start your word processor. Direct printing of your
document to a line printer (e.g. LPT1:). You may see some disk
activity, as REPRINT will clear its buffer to the print file as
the buffer fills.

When the word processor finishes 'printing' the document, exit
the word processing program. Now flush the remaining characters
from the memory buffer to the print file using the command:

REPRINT /N

The print file, REPRINT.LPT, will contain all the characters
which were sent to the printer by the word processor. With the
/N switch above, any further printer output will be sent to a
NULL device (i.e. not saved in a file nor sent to a printer).
However, you may restore your printer operation by using:

REPRINT /P
send more print characters to the current file with:

REPRINT /F

or you can establish a new print file with:


REPRINT NEW.LPT

The /F switch is implied when a new print file is specified. If
the current print file is not empty, you will be asked if you
wish to append or overlay over the current file. You may also
exit without appending or overlaying the current file with a
carriage return.

The file name given on the command line can include a path
description for the file. Thus, the print files can be saved in
a special directory away from the word processor or printing
program. For example:

REPRINT \PRINT\NEW.LPT

will open the file NEW.LPT in the directory \PRINT. The
specified directory must exist or REPRINT will exit with an file
creation error.

USING THE BUFFER SIZE OPTION

The memory buffer allowed by REPRINT ranges from 1 to 48K bytes.
The buffer size is set when REPRINT is made resident in memory.
If you wish to start REPRINT with a buffer of size 32K, use the
command:

REPRINT /32

A larger buffer means REPRINT will not have to write to disk as
often, but it also means that less memory is available for other
programs. The /F switch is implied when no other switch is given
with a buffer size. If REPRINT is already resident, its buffer
size cannot be changed.

TESTING REPRINT FROM THE MS-DOS PROMPT

REPRINT will work with the MS-DOS Command processor, sending all
characters intended for the LPT devices to a print file buffer.

Examples: If REPRINT is set to file redirection, the command:

COPY FOO.BAR LPT1:

will send the file FOO.BAR to the REPRINT memory buffer, which
can then be saved to a file with the REPRINT/N command. If
FOO.BAR is a large file, you should expect some time delay as the
file is transferred (about 1 second for each 1000 bytes sent at
the standard PC clock speed) due to the way COPY handles the
printer devices. Note that the COPY command (without the COPY /B
switch) will terminate the copying of a non-EXE or non-COM file
when a CTL-Z is encountered. Thus text files with embedded CTL-
Zs will be truncated. Since the COPY command operates from
within MS-DOS, the memory buffer cannot be written to a disk file
during the copy operation. When the memory buffer fills, REPRINT
will set redirection to the null device to prevent the buffer
from overflowing.

REPRINT also handles the CTL-P printer output at the MS-DOS
command level. The routine which performs CTL-P print
redirection does permit print file writing, so that the memory
buffer does not have to be larger than the expected number of
print characters. REPRINT will flush to the print file each time
the buffer fills. However, some care is needed in using CTL-P
redirection to a file, as there is no indication in MS-DOS if the
CTL-P is switch is on or off, except the printer noise when no
redirection is used.


GETTING A STATUS REPORT

By using the command REPRINT without any further command tail,
REPRINT will display a report of the current buffer contents,
the maximum buffer size, the print file size, and the current
device it is using for print file redirection.

TECHNICAL COMMENTS

REPRINT intercepts interrupt 17H used in the IBM PC BIOS to
control the parallel printer ports. Almost all software run on
PC Compatible machines which send output to the printer devices
LPT1: to LPT4: will directly or indirectly pass through interrupt
17H. REPRINT checks to see if the INT 17H function request is
printer output. If it is not, control is passed to the original
BIOS routine. If printer output is requested, REPRINT then
checks for the current status of the redirection: file, printer,
or a null device. If redirection is to a printer, again the
control is passed to the original BIOS routine. If redirection
is set to a file, REPRINT saves the print character in a resident
memory buffer until that buffer fills. When the buffer fills,
REPRINT attempts to write the buffer to the specified disk file.
This attempt will fail if REPRINT finds the MS-DOS critical flag
is set (as in the case of an INT 17H being generated from within
MS-DOS itself). When the critical flag is set, REPRINT sets a
flag to catch the next INT 21H and then attempt to flush the
print buffer to the disk file. If this fails, it stops further
buffer action by setting the redirection to a null device.

REPRINT will stay resident until the system undergoes a cold
boot. However, it should not interfere with any other program.

VERSION CHANGES

Reprint Version 1.2 differs from Version 1.1 in the following
ways:

1. REPRINT is now able to write its buffer to disk even when the
print command occurs inside an MS-DOS call, provided an MS-DOS
function call is made before another 256 bytes are buffered.
When such a print command occurred under Version 1.1, REPRINT
could only save characters up to is buffer size, but then was
forced to set redirection to the Null device.

2. The REPRINT status report is now given without the complete
help screen with the REPRINT command. The help screen now only
appears when an incorrect switch is given.

3. The status report has been expanded to give the memory buffer
current byte content, buffer size, print file name, the print
file size, and the current LPTn: redirection.

4. The request to overwrite or append to the print file is no
longer given when the print file has 0 bytes.

5. When a new print file name is established, that new name does
not need to be given again when the /F command is reissued.

6. No attempt is made to flush an empty buffer when the /N switch
is given after the /F switch.

7. The /F switch is no longer needed when a new print file is
specified, or when the /BB buffer size is given.

































































 December 23, 2017  Add comments

Leave a Reply