TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Fitzsimmons
from: Gary Chambers
date: 1996-03-02 19:17:40
subject: Printing

-=> Quoting Peter Fitzsimmons to Gary Chambers <=-

 PF> If you just want to print plain text,  and you don't mind pissing off
 PF> people with postscript printers,  simply use fopen("prn",
"wt") with
 PF> fprintf(). 

I used this method (except with DosOpen, DosWrite, etc), and while it
worked, it created a very large assortment of spool files that OS/2
couldn't/wouldn't delete.  As a result, I've removed the code and have
begun to study the code attached to this message.

BTW, I looked at all the .SPL files in my spooler subdirectory, and they
*ALL* (those produced by my program, anyway) had the read-only bit set.
Could this be caused by the method in which I open the printer?  Code to
follow:

rc = Dospen("PRN", &hPrinter, &ulAction, 0L,
OPEN_ACTION_OPEN_IF_EXISTS,
            OPEN_ACCESS_WRITEONLY, OPEN_SHARE_DENYNONE, 0L);

 PF> Otherwise,  you've got to jump headfirst into PM fonts &

Here we go...  ...

 PF> 1) I didn't have to query the current form to find the
 PF> default page size;  I could have simply used GpiQueryPS()
 PF> to query the size of the presentation space.

How does this relate to the printed page?  Is this automatic?  In other
words, I can use GpiQueryPS and it will return measurements of the default
form size in the installed printer?

 PF> 2) It is sometimes better to use TWIPS instead of PELS for
 PF> the presentation units -- since a twip is 1/20 of a point,

Thanks for the advice.  I see there are quite a few choices in the
measurement arena; some quite surprising to me, actually.

 PF> * This sample program contains the least amount of code I could
 PF> write * to do PM text printing,  to the system default printer.

This is incredible!  I know it's probably well worth my trouble to learn
about the intricacies of PM printing, but looking at the depth of the
preliminaries, it sure appears to be a daunting task.

Thanks for the very informative reply...

GeeCee/2


... Topsham, ME 43 57.0'N 69 57.0'W
--- Blue Wave/OS2 v2.20 [NR]
* Origin: Mystic Seaport Inn OiS/2 - USR DS V.34+ - (207)721-3258 (1:326/426)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 326/426 411 400 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.