[comp.sys.mac] Printing stuff in Lightspeed C

thompson@uxf.cso.uiuc.edu (02/14/88)

OK.
Got a fun one.

I am porting a C program from the IBM to the Mac.  I know it will look
and feel strange on the Mac, but the primary objective at this point
is to get it *functional*.

Unfortunately, the C from which I am porting has a library function,
stdprn, which is the standard printer port (accessed like a file).
The C to which I am porting (Lightspeed v2.11) does not.  In fact,
in all the documentation and examples, I am told I must open a grafport
and draw my text into it before I can get things to print out.

All I want to do is send lines of text to the printer.  Without opening
grafports or drawing text (this program makes no other use of that stuff,
of course).  Is there no way to do this?

leonardr@uxe.cso.uiuc.edu (02/16/88)

thompson@uxf.cso.uiuc.edu(??) writes in comp.sys.mac

>I am porting a C program from the IBM to the Mac.  I know it will look
>and feel strange on the Mac, but the primary objective at this point
>is to get it *functional*.
>
>Unfortunately, the C from which I am porting has a library function,
>stdprn, which is the standard printer port (accessed like a file).
>The C to which I am porting (Lightspeed v2.11) does not.  In fact,
>in all the documentation and examples, I am told I must open a grafport
>and draw my text into it before I can get things to print out.
>
>All I want to do is send lines of text to the printer.  Without opening
>grafports or drawing text (this program makes no other use of that stuff,
>of course).  Is there no way to do this?
	The answer to your question is: Yes.  You can stream text out to a 
printer just like on non-Mac machines, however doing so is not recommend by
the powers that be (The Apple Thought Police and their Development Group). Your
best bet is to do it the proper way by using the printing manager and using all
the grafport and drawing of text that you refer to.  This is the proper method
for printing on the Mac and it guarentees that you can print to ANY attached
printer instead of just the ImageWriter (which is what text streaming will get
you).


+---------------------------------+-----------------------------------+
+                                 +  Any thing I say may be taken as  +
+   Leonard Rosenthol             +  fact, then again you might decide+
+   President, LazerWare, inc.    +  that it really isn't, so you     +
+                                 +  never know, do you??             +
+   leonardr@uxe.cso.uiuc.edu     +                                   +
+   GEnie:  MACgician             +                                   +
+   Delphi: MACgician             +                                   +
+                                 +                                   +
+---------------------------------+-----------------------------------+