home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
printer
/
vprnt301.arc
/
VPRINT.DOC
< prev
Wrap
Text File
|
1987-04-12
|
31KB
|
1,387 lines
READ
THIS
BEFORE
PRINTING!!!!
This document has been formatted in a special way. Virtually all dot
matrix printers have a condensed mode which prints 132 characters
across a standard 8 1/2 inch page. When this file is printed out in
condensed mode, the resulting printed pages can be cut down to 5 1/2 X
8 1/2 inches. The cut pages will fit nicely in the back of your
DOS manual for storage.
Typically, you can turn on this mode by sending a special control
sequence to the printer from BASIC. For example, you can turn on the
condensed mode of the IBM/Epson printer with the BASIC statement:
LPRINT chr$(15). If your printer has such a condensed mode, turn it
on now, before printing the rest of this document.
(tm)
VPRINT
Virtual Printer Utility
for the IBM Personal Computer
User's Manual
(c) 1986, 1987 by David Whitman
Version 3.01
David Whitman
P.O. Box 1157
North Wales, PA 19454
(215) 234-4084 (evenings only)
Table of Contents
What is VPRINT?.............................................1
System Requirements.........................................2
Starting VPRINT.............................................3
Advanced Usage..............................................4
Emulation Options...........................................5
Filter Options..............................................6
Enable Options..............................................7
Miscellaneous Options.......................................9
Limitations................................................10
Miscellaneous and A Word From Our Sponsor..................12
Registration Form..........................................17
1
>> What is VPRINT? <<
VPRINT implements a "virtual printer" by capturing output
normally sent to your printer and redirecting it to a file of
your chosing. There are many reasons you might want to capture
printer output:
* Producing formatted files from software packages that don't
support "printing to disk".
* Setting up word processors and other programs to work with
your printer. By capturing to disk, you can see exactly
what's being sent, and pinpoint problems immediately.
* Capturing output generated on one computer, to be printed on
a different system.
* Taking disk "snapshots" of your video screen. When VPRINT
is running, the PrtSc key copies the screen to your disk
file.
* Delaying printer output for later printing. VPRINT responds
much faster than a "real" printer, but takes up much less
memory than most print spooling software. If you can't
afford the memory for a print spooler, you can VPRINT
quickly, then print the file later during a time when your
computer is idle.
2
>> System Requirements <<
To run VPRINT, you need:
IBM PC
64K of memory, minimum
1 disk drive, minimum
DOS 2.0 or later
VPRINT is designed to run on IBM PCs, but should run on all
systems that are compatible with the IBM BIOS.
The following systems are known to run VPRINT successfully. If
you are using VPRINT on a computer not on this list, please
write, and the list will be updated so that others can share this
information.
IBM PC
IBM XT
IBM 3270 PC
IBM 3270 PC/G
3
>> Starting VPRINT <<
To capture printer output, you must "install" VPRINT.
Installation temporarily grafts a portion of VPRINT onto your
computer's input/output system. Once installed, VPRINT remains a
part of the I/O system until you either shut your computer off,
or reset the system by pressing Ctrl-Alt-Del.
To install VPRINT, type:
VPRINT filename.ext /i
Use whatever filename you'd like printer output to be sent to.
The filename can optionally have a drive and/or pathname. If you
don't use a filename, VPRINT will create a file named
VIRTUAL.PRN for you in the root directory of the default drive.
The "/i" tells VPRINT that you want to install the program, and
if a filename is used, the "/i" must come AFTER the filename.
After you type the above command, VPRINT will respond:
VPRINT - virtual printer (version 3.01)
User-supported software by D. Whitman
For help/info, type VPRINT ?
Resident section has been installed.
As programs attempt to send output to your printer, VPRINT
intercepts the output, and stores it in an internal buffer.
Every time this buffer fills up, VPRINT dumps the buffer to the
disk file you specified during installation.
After you have finished your printing, the buffer may still
contain some of your output, not yet transferred to disk. Before
using the output file, you should ask VPRINT to "flush" the
buffer, using the command:
VPRINT /f
4
>> Advanced Usage <<
The procedure given in the previous section will allow you to
capture printer output from most software packages, but does not
make use of all of VPRINT's capabilities. This section will
discuss these further options.
The VPRINT command has the following syntax:
VPRINT [?] [d:][path][filename[.ext]]] /options
If you type VPRINT ?, a one page help screen will be printed.
You can specify a fully qualified file name, including drive and
path. After installation, you can change the active printer file
by running VPRINT with a different filename. This modifies the
resident code without loading a new copy or using more memory.
VPRINT's options all start with a slash character "/" followed by
a single letter or number. If a filename is used, the options
must come AFTER the filename. Multiple options can be used. The
following options are available:
/i install (required to load resident code)
/f flush - empty any buffered output to disk
/s report status
/1 emulate LPT1:
/2 emulate LPT2:
/3 emulate both printers (default)
/n neutral - don't filter output (default)
/l drop LFs, expand CR to CR LF
/c drop CRs, expand LF to CR LF
/d disable - flush buffer, use physical printer
/e enable - use virtual printer again, after /d
/h harmless output - use ultra-safe output (default)
/r risky output - allow some risk in output
Again, like the filename, you can install VPRINT using one set of
options, then change by running VPRINT again with different
options. The new options will modify the resident code without
using more memory. The following sections will discuss these
options in more detail.
5
>> Emulation Options <<
You can control which printer port(s) VPRINT emulates. By
default, VPRINT redirects printer output intended for both LPT1:
and LPT2:. You can restrict this to only one printer using
options /1 and /2.
For example, if you only want to capture output from LPT1:, you
would install VPRINT like this:
VPRINT /i /1
Alternatively, if VPRINT is already installed, you can restrict
capture to LPT2: with this command:
VPRINT /2
The /3 option returns you to the default state, where output to
both printer ports is captured.
6
>> Filter Options <<
By default, VPRINT stores to disk exactly what is being sent to
your printer. However, under certain circumstances, it is
desirable to "filter" the output slightly.
Standard DOS files end each line with a carriage return character
(CR), followed by a line feed character (LF). Many programs,
including most word processors, will require files to be in this
format. Unfortunately, when sending output to a printer, not all
programs terminate lines with a CR LF pair.
For example, Volkswriter sends only line feeds at the end of
blank lines. This works fine when sent to a printer, but if
captured to a file, the resulting file will look very strange
when re-edited. (Multiple blank lines disappear, and are replaced
with a single line full of boxes with holes in them -the screen
representation of the line feed character.)
At least on older PC's, the PrtSc function acts even stranger.
PrtSc terminates each line exactly backwards, with a LF followed
by a CR. This combination will confuse most text editors,
causing very strange behavior.
VPRINT has two "filtering" modes which tend to force printed
output into standard DOS format. These modes ignore either CRs
or LFs, while replacing the other character with a CR LF pair.
Option /C ignores carriage returns, and expands LF to CR LF.
Similarly, /L ignores printed line feeds, but adds one after each
CR.
If your captured output looks strange, try turning on the
different filtering modes and see if your output looks more
normal.
You can turn off filtering with the /N option. After /N is in
effect, output will again be captured verbatim.
7
>> Enable Options <<
Once VPRINT is installed, it remains a part of your computer's
input/output system until you either turn off your computer or
re-boot. However, VPRINT can be temporarily disabled to allow
output to go to your printer as usual.
Option /D disables VPRINT. When /D is in effect, VPRINT remains
resident, but passes output unmodified to your printer. Option
/D also flushes VPRINT's internal buffer, so that all your output
is available on disk.
Option /E enables VPRINT, presumably after it's been disabled
with option /D. When option /E is in effect, printer output is
once again redirected to your disk file.
8
>>Output Mode<<
For technical reasons, it can be dangerous for a memory resident
program like VPRINT to perform disk access. If disk output is
performed at an inopportune moment, your computer could lock up
and require rebooting. To help avoid this situation, VPRINT
supports two modes of disk output.
Option /H specifies harmless output, and is the default mode.
When /H is in effect, VPRINT will only attempt to write to disk
under circumstances it KNOWS will be safe. However, this can
present a problem if VPRINT's internal buffer fills up before a
known safe opportunity occurs. VPRINT addresses this situation
by accepting as much output as possible, then simply ignoring
additional characters until an opportunity for output occurs.
Whenever VPRINT's buffer is getting too full, a status signal is
returned after each print request indicating that your printer is
"turned off". If your software monitors printer status during
output, it should stop and ask you to correct the situation.
Often, VPRINT will be able to dump its buffer to disk during the
time your software is asking you to turn the printer back on.
You should be able to restart printing immediately, with no other
action on your part. If the restart is unsucessful, abort
printing, and try changing VPRINT's output mode to /R.
Option /R specifies risky output. When /R is in effect, VPRINT
will write output to disk whenever its internal buffer fills up.
You should use risky mode with programs that don't intelligently
monitor printer status during printing, and might lock up or
continue to output after VPRINT's buffer was full. While it is
safer and preferable to use "harmless mode", most programs will
be compatable with "risky mode". (In fact, earlier versions of
VPRINT used only this mode.) Incompatibility will be obvious;
your computer will lock up after a few pages of output, and
you'll need to reboot.
NOTE: Since it *is* slightly risky, it's probably a good idea to
back up any data on your system prior to activating option /R.
9
>> Miscellaneous Options <<
A short help summary will be printed if you type VPRINT ?, or
just VPRINT with no other options.
The /I option installs VPRINT. This option loads VPRINT's
resident code, and grafts it onto the I/O system of your
computer. Once VPRINT is loaded, there is no need to specify
/I on subsequent commands. If you use /I when the resident code
is already loaded, VPRINT will detect the resident code and will
print an error message without re-loading.
Option /F flushes VPRINT's internal buffer to disk. To avoid
constantly running your disk drive during printing, VPRINT
collects about 2000 characters, then writes them to disk all at
once. Unless you output an exact multiple of 2048 characters,
when printing is finished, part of your output is still in
VPRINT's internal buffer. Option /F forces the last part of your
output to disk.
Incidentally, VPRINT's internal buffer is automatically flushed
before shifting to a new file, and also before disabling, if you
turn on option /D.
Option /S prints a status report, indicating which options are in
effect, and where your printed output is being sent. This is the
same report which is printed after using any of the other
options, but /S allows you to check status without changing
anything.
10
>> Limitations <<
VPRINT writes to your disk drive using functions provided by DOS.
Technically, it is "illegal" for the input/output system to get
services from DOS (the organization is such that DOS is supposed
to get services from the input/output system, not the other way
around) but under almost all circumstances, VPRINT gets away with
this irregularity, particularly when harmless mode is active.
Although it would have been possible to design VPRINT to go
around DOS and take direct control of one of your disk drives,
this would run the risk of destroying data on the disk if
something went wrong. By asking DOS for services, disk data is
best protected, but at the risk of locking up your system under
certain rare circumstances.
The technical problem is caused by a phenomenon called
re-entrance. If VPRINT calls DOS for services when DOS is
already busy, things can get messed up, and your system can
crash. Particularly bad is the situation where the same section
of DOS that VPRINT calls for disk output is calling VPRINT for
printer output. Situations where DOS treats your printer like a
disk file tend to give VPRINT problems.
For example, when VPRINT is installed in risky mode, the
following DOS command will often lock up your system:
COPY filename1 PRN
DOS treats device PRN like a disk file, and when VPRINT calls DOS
for services, the appropriate routines are already in use. A
lock up can result. Note that there would be no point in issuing
this command with VPRINT resident, since you could accomplish the
same task with:
COPY filename1 VIRTUAL.PRN
11
Similar lock-ups can occur if you perform i/o redirection to one
of DOS's reserved printer devices. For example, in risky mode:
DIR >LPT1:
will sometimes lock up the system. Again, with VPRINT resident,
you can accomplish the same thing (safely) with the command:
DIR >VIRTUAL.PRN
Another source of lock-ups would occur if you specified one of
DOS's printer devices as the file for VPRINT to use. For this
reason, VPRINT will reject filenames PRN, LPT1: or LPT2:.
Again, there is no reason to want to VPRINT to one of the printer
devices. To send output to a printer, just disable VPRINT with
option /D.
12
>> Miscellaneous and a Word From Our Sponsor...<<
A. Programming Notes
1. VPRINT is written in assembly language for maximum speed
and minimum size. The source code is available to
registered users by sending a formatted disk and a stamped
return mailer. The source code is in the syntax of the
CHASM assembler, which is another product of Whitman
Software. A one page advertisement for CHASM is given near
the end of this document.
If you make any improvements in VPRINT, I'd like to hear
about them for possible inclusion in future releases.
Please note that although you can modify VPRINT for your
own use, under NO CIRCUMSTANCES may you distribute modified
or translated versions, either in the public domain or for
profit.
2. VPRINT monitors BIOS interrupts 17H (PRINTER_IO), and 28H
(DOS_IDLE). No other interrupts are affected. Virtually
all software interfaces to the parallel ports via interrupt
17H. Obviously programs which bypass the BIOS for printer
output will be unaffected by VPRINT.
DOS_IDLE is an undocumented interrupt which is executed by
DOS during keyboard input, and possibly other times. Disk
i/o is safe during int 28H, and intercepting this vector is
one of the methods VPRINT uses to perform "harmless mode"
output. The DOS PRINT command functions by intercepting
int 28H.
3. To change options in the resident code, VPRINT examines the
vector for interrupt 17H, then searches at the specified
location for a "recognition string". If this recognition
string is not matched, changes are aborted. If you load
another memory resident program after VPRINT that
intercepts interrupt 17H, you will not be able to change
options or files used by the resident part of VPRINT.
13
4. DOS is not re-entrant, and it is supposed to be illegal for
interrupt handlers to call DOS. VPRINT seems to get away
with it though, and the function seems useful enough
justify the risk of a system crash. I strongly urge that
you back up all data before turning on risky mode.
B. Red Tape and Legal Nonsense:
1. Disclaimer:
VPRINT is distributed as is, with no guarantee that it will
work correctly in all situations. In no event will the
Author be liable for any damages, including lost profits,
lost savings or other incidental or consequential damages
arising out of the use of or inability to use this program,
even if the Author has been advised of the possibility of
such damages, or for any claim by any other party.
Despite the somewhat imposing statement above, it *is* my
intention to fix any bugs which are brought to my
attention. Note that since VPRINT breaks one of DOS's
rules, there may be circumstances which have no possible
correction.
2. Copyright Information
The entire VPRINT distribution package, consisting of the
program, documentation file, and source code file are
copyright (c) 1986 and 1987 by David Whitman. The author
reserves the exclusive right to distribute this package, or
any part thereof, for profit. The name VPRINT (tm) applied
to a microcomputer printer redirection utility is a trade
mark of David Whitman.
The VPRINT package (with the exception of the source code
file VPRINT.ASM) may be freely copied by individuals for
evaluation purposes. It is expected that those who find
the package useful will make a contribution directly to the
author of the program.
14
VPRINT's source code is made available to registered
users for educational purposes and to allow them to
customize for their own personal use. The source code file
is available only to those who make the suggested payment
for use of VPRINT. Under NO CIRCUMSTANCES may modified
versions or translations into other computer languages be
distributed, either for profit or in the public domain.
User's groups, clubs, libraries and clearing houses are
authorized to distribute VPRINT under the following
conditions:
1. No charge is made for the software or documentation. A
nominal distribution fee may be charged, provided that
is no more that $8 total.
2. Recipients are to be informed of the user-supported
software concept, and encouraged to support it with
their donations.
3. The program and documentation are distributed together
and are not modified in ANY way.
4. The source code file VPRINT.ASM or disassemblies of
VPRINT.COM may not be distributed.
C. An Offer You Can't Refuse.
VPRINT is user-supported software, distributed under a system
identical to the FREEWARE (tm) marketing scheme developed by
the late Andrew Flugelman, whose efforts are gratefully
acknowledged.
Anyone may obtain a free copy of VPRINT by sending a blank,
formatted diskette to the author. An addressed, postage-paid
return mailer must accompany the disk (no exceptions, please).
A copy of the program, with documentation, will be sent by
return mail. The program will carry a notice suggesting a
payment to the program's author. Making the payment is
totally voluntary on the part of the user. Regardless of
whether a payment is made, the user is encouraged to share the
program with others. Payment for use is discretionary on the
part of each subsequent user.
15
The underlying philosophy here is based on the following
principles:
First, that the value and utility of software is best assessed
by the user on his/her own system. Only after using a
program can one really determine whether it serves personal
applications, needs, and tastes.
Second, that the creation of independent personal computer
software can and should be supported by those who benefit
from its use. Remember the Tanstaafl principal: There
Ain't No Such Thing As A Free Lunch. Support to authors
encourages the continued creation of novel, low cost
software.
Finally, that copying and networking of programs should be
encouraged, rather than restricted. The ease with which
software can be distributed outside traditional commercial
channels reflects the strength, rather than the weakness,
of electronic information.
If you like this software, please help support it. Your support
take three forms:
1. Become a registered user. The suggested payment for
registration is $15.
2. Suggestions, comments and bug reports. Your comments will
be taken seriously. VPRINT will evolve over time, based
on the feedback of users.
3. Spread the word. Make copies for friends, or send the
program to your favorite BBS. Astronomical advertising
costs are one big reason that commercial software is so
overpriced. To continue offering VPRINT this way, I need
your help in letting other people know about VPRINT.
16
Those who make the suggested $15 payment to become registered
users receive the following benefits:
1. Access to VPRINT's heavily commented source code.
2. User support, by phone or mail. SUPPORT IS ONLY AVAILABLE
TO REGISTERED USERS.
3. Notices of significant upgrades.
4. A warm, fuzzy feeling of having done the right thing. The
converse is also true. If you continue to use VPRINT
without making the suggested payment, your self-image will
gradually deteriorate until you wake up one day in the
gutter on Skid Row, grubbing for cigarette butts and
discarded floppy disks. Honest.
This documentation file was written using Volkswriter 3, then
printed and captured by VPRINT to eliminate Volkswriter's special
effects markers and get proper pagination. Option /C was in
effect to force line feeds into CR/LF pairs.
- Dave Whitman
Whitman Software
P.O. Box 1157
North Wales, PA 19454
(215) 234-4084
17
>> Registration Form (version 3.01)<<
Please send me a copy of the current version of VPRINT, and
add me to the list of registered VPRINT users, to be eligible for
phone support and upgrade notices. I enclose a check for $15.
Note: as of version 2, VPRINT requires DOS 2 or later to run.
Computer Model: ______________________________
Diskette Format: ____ single _____ double sided
Where did you hear about VPRINT? _______________________
=========================================================
Name: ______________________________________
Address: ______________________________________
City, State, Zip: ______________________________________
==========================================================
Send registration form and check to:
Whitman Software
P.O. Box 1157
North Wales, PA 19454
18
>> Also Available <<
CHASM is a full featured assembler for the IBM PC.
Substantially simpler than the IBM macro assembler, CHASM is
particularly suited for those learning assembly language.
Using CHASM you can:
* Learn 8088 / 8086 / 8087 assembly language.
* Explore the inner workings of the IBM PC.
* Write lighting-fast stand alone programs.
* Produce machine language subroutines for BASIC programs.
* Write external procedures or inline code for Turbo Pascal.
Although easy enough for beginners, CHASM is powerful
enough for production coding. VPRINT was produced using CHASM.
CHASM features macros, conditional assembly, structured
variables, operand expressions and much more. A free evaluation
version can be obtained by sending a formatted disk and stamped
return mailer to:
Whitman Software
P.O. Box 1157
North Wales, PA 19454
A payment of $40 is requested from those who find the program
useful. Those who make this payment are upgraded to a version
which runs twice as fast.