home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
print
/
prtf
/
prtf.doc
< prev
next >
Wrap
Text File
|
1993-09-01
|
5KB
|
115 lines
Function:
This program prints a text file using PM's Postscipt fonts, rather than
printer's own fonts (as would COPY file LPTn). It works from full-screen
sessions and from batch files. I was amazed that such an obvious utility is not
included with OS/2, so I wrote one and am putting it out for beta-testing.
Please let me know at the address below if you come across any bugs or if you
have suggestions for additional features. I don't promise to answer every
letter but I will try to read everything and take it into consideration for
future versions.
Usage:
prtf file [options]
Options can be specified in any order.
Option default
-f "Face Name" Courier
Important! Put multi-word face names in quotes, e.g.,
-f "Times New Roman Bold"
-f "Helvetica Bold Italic"
-q queue default queue
-p n pointsize 12
-c n # copies 1
-a spooler parameters
Switches:
-i Italic (This is in addition to -f "<Face> Italic")
-u Underscore
-b Bold
-s Strikeout
-o Outline
Examples:
prtf notice -o -i -b -p 168 -q laser
prints a large notice on the "laser" queue, which may have been previously
set to landscape.
prtf testf -c 50 -a "FORM=A4" -f "Helv Italic"
prints 50 copies of testf using 12-pont Helvetica Italic and A4 form on the
default queue.
You can also use the PostScipt fonts in your printer, but you must spell
out their names, e.g. -f "ITC Zapf Dingbats".
Known bugs:
1. EPSON device driver hangs when it receives DevEscape(...ENDDOC...).
I think it's a bug in that driver, not in this program. DON'T USE THIS
BETA VERSION WITH EPSON.DRV. It seems to work fine with all the other
printer drivers I've tried.
2. OS/2's SplQueryQueue API sometimes returns garbage (2 smiley faces) instead
of the printer driver. The remedy is to open the settings notebook for the
printer queue, go to the "printer driver" page, and click on the default
printer driver. This is definitely a bug in OS/2 2.1 and not this program.
3. Certain PostScript printers complain about forms mismatch, print anyway.
Limitations and other notes:
Because the program must work in full-screen mode, it cannot bring up
job dialog and font selection boxes. If you want to set job parameters,
such as landscape printing, do it before using the printer object.
In particular, if your spooler queue is set to print to file and the
dialog box must be displayed, prtf won't print (there will be an
error about the print job aborted when opening device context).
Some text files use backspaces and carriage returns without line feeds
to generate overstricken characters and underlining. This should work with
fixed-width fonts.
Network printing: Because the picture is computed locally, PM does not allow
UNC names for remote queues. To print to a remote queue, install it locally
using Templates->Network printer->Install.
Source code:
The source code compiles under IBM C Set++. It demonstrate the usefulness of
the goto statement. The commented code under "never" demonstrates an
alternative way of sending data (raw only!) to a printer queue using spl calls.
I've noticed that such programs as emTeX and the various ports of Ghostscript
all try to handle various printers by providing their own device drivers. This
program shows how one can compose a page and let Presentation Manager print it
using its own device-specific driver. I'll be happy to see this trick
incorporated into programs, which brings us to the subject of
Copyright:
This program is copyrighted (C) 1993 by Dimitri Vulis. However the public
is granted an unlimited licence to do as it pleases with this program and
its source code. Obviously, there is
No warranty:
This program is provided "as is" without warranty of any kind. This is a
beta-test program which may be reasonably expected to contain "bugs". You
assume all risks of running such a beta test program in a production
environment.
Donations:
If you find this program useful, please send me $20. If you can't afford $20,
I'd appreciate $5. But you don't really have to. :)
Author:
Dimitri Vulis
67-67 Burns St., Apt. 4K
Forest Hills, NY 11375
Tel: 718-261-6839
Internet: DLV@DM.COM