Contents of the TPSPOOL.DOC file
TPSPOOL - Simple Print Spooler written in Turbo Pascal 4.0
Released to the Public Domain AS IS!
Written on or about 12/5/87
VERSION 0.8!!! You get what you pay for.
Uses TurboPower's Turbo Professional 4.0.
This program captures printer output and saves it in a file. The printer
output is captured by trapping the BIOS interrupt 17h and hijacking the
If you do not specify a number on the command line, TPSPOOL will use a large
buffer. The buffer should be large enough to store the most characters that
will be written at once. Future versions may not impose these requirements.
In practice, I believe 16K, 32K, or the default of about 64K should work in
most cases. The next version will use EMS for the big buffers, freeing
valuable main RAM.
In keeping with the Turbo Pascal tradition, Hex numbers may be passed on the
command line by preceeding them with a $.
The program will display some text, then terminate and stay resident. To
activate, hit Alt-Tab (Alt key and Tab key at the same time). This "hot key"
toggles the spooler on and off. When the spooler is off (the default), hitting
Alt-Tab will beep and turn it on. When the spooler is already on, typing
Alt-Tab will disable the spooler and dump the buffers to the spool file.
All printer output is spooled (stored) in the disk file SPOOL01.TMP. If a
file by this name exists, it is appended, if not, it is created. Future
versions will allow other file names.
Some examples of command line options:
This would use the default (biggest possible) buffer size.
This would use a 16K buffer
This would use a 32K buffer
This would use a 1K buffer. This is probably too small unless you can
guarentee that only Int 17h will be used to send output to the printer.
See technical notes.
The most common problem experienced with this program is running
it but forgetting to enable the spooler by pressing Alt-Tab. This will
cause output to go to a printer if one is attached just like normal. If a
printer isn't attached, YOU MUST ENABLE THE SPOOLER BEFORE TRYING TO PRINT.
If a single write to the PRN device via a DOS Write Handle or Device call is
larger than the specified buffer size, this program will hang. This is why
the default is almost a full 64K. In reality, most programs send small chunks
of 1K or less to the PRN device. If the program uses Int 17h directly (like
most Word Processors), any buffer size of 1K or more will work safely. I
recommend 4-16K if memory is tight, or 16-64K if it's not.