[comp.sys.next] iwf: a better way to print to an Apple ImageWriter II

eps@toaster.SFSU.EDU (Eric P. Scott) (11/08/90)

One tried-and-true way of getting a halfway decent program
written is to release a really lousy implementation so someone
else will come along and say "*I* can do better than THAT."
Well, I'd like to take a moment to thank Mr. Robert Lin for
creating the truly wretched iwscript, so I can tell you this
little story.

			      * * *

I was wandering through one of our storage areas, and found
(quite literally) a pile of Apple ImageWriter IIs.  My
conversation with the person nominally responsible for them
went something like this:

"What are all these ImageWriters doing here?"

	"Nothing."

"Do they work?"

	"Every one of them.  In fact, this one's brand new, never
	 used."

"Why aren't these printers being used?"

	"We don't have AppleTalk cards for them."

"Can I walk off with one?"

	"Sure."

Heh heh.  Betcha I can turn this into a PostScript(R) printer
real easy.

			      * * *

Not being one to reinvent the wheel unless severely provoked, I
promptly FTPed iwscript from the Purdue archive.

What a piece of crap.  Unbelievable garbage.  Doesn't even work
right, and this guy wants money for it?  I'm amazed he'd even
put his name on it.  Why does it want to use ttyb?  That's the
one with +5v on it.  God, what a cretin.  Another damn binary.
Well, I guess *I'm* not going to fix it.  I'd probably get
sick reading his code anyway.  It's not like this isn't trivial
to rewrite.  I could probably throw a working one together in
an evening.  He's selling this?  What a ...

Hey--do we have any documentation on this thing?  There's an
Owner's Manual for it?  Great...  Let's see.  This isn't what I
want, this tells you how to put paper in it.  It says there's a
Technical Reference Manual.  Do we have that?  Do you know who
might have that?  Uh, thanks.  I'll see what I can come up with.

Well, this might take more than an evening.  The Owner's Manual
has a "Quick Reference Card" in the back.  It's not all that
helpful.  It's not hard to see how to blast bitmaps at this
thing, but there are some things that don't make any sense.
This can't be right.  How do I set tabs on this thing?

			      * * *

I'm so busy, I don't even have time to play with the ImageWriter.
Might as well check my mail.  Damn, all the real computers are
being used.  Guess I'll have to log into the A/UX machine.  A/UX
machine!  Wait a minute...  there's probably something in the man
pages...  Hot damn.  Look at this--iw2.  You give it options you
want and it spits out the escape sequences.  I'll have to play
with it later, though.

			      * * *

It's so simple!  So obvious!  A child could... Dammit Jim, I'm a
programmer, not a doctor.  This is gonna be awesome.


Well, to make a long story short, I wrote "iwf" (ImageWriter
Filter, how original, huh?) from scratch "in no time at all,"
and since *I'm* not out to give shareware a bad name, you get to
use it for FREE.  Of course, if you really think this is worth
$25 (or whatever), feel free to donate to the League For
Programming Freedom or the EFF.  Just don't send it to me--I work
for the government, and I'm here to help.  :-)


In case anyone should ask you WHY iwf is really better than
iwscript, here's a brief comparison:

iwf				iwscript
---				--------

Handles both PostScript and	PostScript only--
"straight ASCII"		you can't "just lpr" text files

Handles arbitrary multipage	Insists on Conforming PostScript
documents

Works with FrameMaker		"Loses" your output
files produced on non-NeXT
workstations

Generally produces accurate	Not even close
rendering of gray levels

Does what printcap tells it	Has /dev/ttyb hardwired in

full source code provided	binary only

it's FREE!			$25 shareware ripoff

There's more, but I won't belabor the point.


iwf-1.1.tar.Z is available for anonymous FTP from sutro.sfsu.edu
[130.212.15.230] in the pub subdirectory.  The man page includes
a sample printcap entry.

N.B.: ImageWriter IIs are *not* a substitute for laser printers.
They're slow, they jam a lot, and their output quality is nothing
to write home about.  If you plan on spending money, buy a NeXT
laser printer or something that talks BSD lpr/lpd protocol over
the Ethernet.  If you're looking for a "cheap printing solution,"
this isn't it.

If you adapt my code to drive a higher resolution printer (read
your license agreement!) I don't want to know about it.  I did
try running the ImageWriter II at 144 dpi, and didn't feel the
results justified the considerably longer printing time.

Finally, you will need to have PublicWindowServer enabled.  I'm
sure the paranoids among you are convinced this is totally evil
(and the CERT advisory didn't tell you the half of it), but I'm
going to defer to NeXT on this.  Perhaps they could extend the
preference to yes/no/maybe, where "maybe" threw up an Alert panel
asking for confirmation for "questionable" connections.  Early
versions of iwf were able to crash the window server quite
unintentionally!

					-=EPS=-