[comp.sys.mac.programmer] How do I write a serial printer dri

gillies@p.cs.uiuc.edu (02/25/89)

Here are some information sources for printer drivers on the mac --

1.  MacTutor had an article by Earle Horton, Nov + Dec 1987.  It gives
a short explanation and lots of code for a serial printer driver.
This driver works, but seems to have some serious bugs (I typed it in
and found them -- my apologies to Earle who is on the net).

2.  The original "phonebook" prerelease version of Inside Macintosh (1985)
describes printing in much more detail.  Our university library has a
copy of the phonebook.  This really gives the best explanation
available, but is way out of date.  Perhaps you can find a veteran
programmer who will loan you his "phonebook".

3.  There is a very recent technote about PrGeneral, I believe, but
this is sort of off-the-topic.

4.  I've been told the printer part of the Mac OS will change, and
Apple is discouraging people from writing printer drivers at this time.


The problem is, you must deal with two types of complexity at once (a)
writing a driver, and (b) writing (essentially) a printing previewer
of some sort.  This is why I haven't done further experimentation --
no time to do all this learning....


Don Gillies, Dept. of Computer Science, University of Illinois
1304 W. Springfield, Urbana, Ill 61801      
ARPA: gillies@cs.uiuc.edu   UUCP: {uunet,harvard}!uiucdcs!gillies

earleh@eleazar.dartmouth.edu (Earle R. Horton) (03/04/89)

In article <104700060@p.cs.uiuc.edu> gillies@p.cs.uiuc.edu writes:
>
>Here are some information sources for printer drivers on the mac --
>
>1.  MacTutor had an article by Earle Horton, Nov + Dec 1987.  It gives
>a short explanation and lots of code for a serial printer driver.
>This driver works, but seems to have some serious bugs (I typed it in
>and found them -- my apologies to Earle who is on the net).
>

     It does have serious bugs.  You can get the 99 44/100 % bug-free
version (now in MPW C) from me if you like.  A donation of $20.00 to
the Horton Life-Style Improvement Fund is suggested.  My hat's off to
you if you typed in that whole thing by hand.  Buy the source code
disk, either the LSC one from MacTutor, or the (bug-free) MPW version
from me.

     I submitted code and an article on a graphics printer driver to
them, also.  It appears that this may be included in the May, 1989
issue.  Maybe I'm being sentimental, but I don't think it would be
ethical to distribute copies of this source code until and unless I
get a rejection letter from MacTutor.  Sorry.

>2.  The original "phonebook" prerelease version of Inside Macintosh (1985)
>describes printing in much more detail.  Our university library has a
>copy of the phonebook.  This really gives the best explanation
>available, but is way out of date.  Perhaps you can find a veteran
>programmer who will loan you his "phonebook".
>

     This is where I got most of the information needed to write the
MacTutor article and code.  I don't know why Apple took it out of the
final Inside Macintosh version, unless they don't want people using
non-Apple printers.

>3.  There is a very recent technote about PrGeneral, I believe, but
>this is sort of off-the-topic.
>
     Yeah, a working printer driver does not need PrGeneral
implemented.  But maybe it couldn't hurt to have one...

>4.  I've been told the printer part of the Mac OS will change, and
>Apple is discouraging people from writing printer drivers at this time.

     The hard part of this for me to understand is how Apple intends
to change the printer part of the OS so that my (or your) printer
driver no longer works, but allowing application programs written for
the "old" printer interface to continue to function.

     I just don't see why printing is not documented fully.  I really
don't.  I wouldn't worry about it, though.  If you need to write a
printer driver now, go ahead and write it.  There are plenty of
sources of non-official documentation on the subject.

>
>The problem is, you must deal with two types of complexity at once (a)
>writing a driver, and (b) writing (essentially) a printing previewer
>of some sort.  This is why I haven't done further experimentation --
>no time to do all this learning....

     It took me two weeks to convert my text printer driver from the
MacTutor article into a graphics printer driver for dot-matrix
printers.  I did this without writing the printing previewer, because
I didn't think of it (dumb).  Anyone who intends to write a printer
driver should therefore be prepared for a lot of work, work which
requires a lot of careful thought, and that's the hardest kind.

Earle R. Horton. 23 Fletcher Circle, Hanover, NH 03755--Graduate student.
He who puts his hand to the plow and looks back is not fit for the kingdom
of winners.  In any case, 'BACK' doesn't work.