[comp.sys.mac.programmer] how can I debug laser-printing problem without a laser printer?

mikem@uhccux.uhcc.Hawaii.Edu (Mike Morton) (03/30/91)

I'm trying to debug a bug in which my application crashes when printing
on several kinds of laser printers.  It works fine on an ImageWriter.
Rather than asking for ideas on what could be happening (though any
such ideas would be welcome), I'd like to find a way to debug it without
having to find a laser printer.

Can anyone think of a way to make a laser printer driver think I have a
real laser printer connected?  I'm willing to go to a fair amount of
effort, since I'd rather not debug this on someone else's machine, and
the application's supposed to ship Real Soon Now.

Please email me, and I'll post a summary.  Thanks in advance.

 -- Mike Morton // P.O. Box 11299, Honolulu, HI  96828, (808) 676-6966 HST
      Internet: mikem@uhccux.uhcc.hawaii.edu
    (anagrams): Mr. Machine Tool; Ethical Mormon; Chosen Immortal; etc.

mikem@uhccux.uhcc.Hawaii.Edu (Mike Morton) (04/06/91)

I recently wrote about trying to debug a bug which caused a crash when
printing to laser printers but not ImageWriters, and wrote:

> Can anyone think of a way to make a laser printer driver think I have a
> real laser printer connected?

The answer Jon W{tte suggested (Francis Stracke and Sak Wathanasin
came up with the same thing) was:

> Just select "LaserWriter" in the Chooser.
> 
> Then, as you print, hold down "K" which will spool PostScript
> to disk instead of printer. Depress K just after you hit "OK"
> in the Print dialog, and hold it down until the "Creating a
> PostScript file" message appears.

This worked fine.  Turns out that my bug was a low-level function
doing a SetPort call shortly before I did the PrClosePage.  The
ImageWriter driver is pretty much done by this point, and seems not
to care, while any laser driver apparently has work left and cares
if the port is still correct.  Thanks for your help, folks.

 -- Mike Morton // P.O. Box 11299, Honolulu, HI  96828, (808) 676-6966 HST
      Internet: mikem@uhccux.uhcc.hawaii.edu
    (anagrams): Mr. Machine Tool; Ethical Mormon; Chosen Immortal; etc.