[comp.sys.mac.programmer] Problem printing to Apple Personal LaserWriter.

casseres@apple.com (David Casseres) (01/26/91)

In article <1CE00001.rxt8na@tbomb.ice.com> time@tbomb.ice.com (Tim Endres) 
writes:
>... after the call to PrPicFile(), I check the PrError()
> result and it return -192 (resNotFound)! All of the other calls succeed
> (PrOpen, PROpenDoc, etc.).
> 
> Stepping through code shows that the error occurs when some code is
> attempting to load a PDEF resource. I did not have the time to track
> down the PDEF resource ID, but believe it was F8FF or -1793. This
> resource is not in the Personal LaserWriter driver file, but other
> PDEF's are.

You should not be calling PrPicFile, because the Personal LaserWriter does 
"draft" printing as opposed to "spooled" printing.  PrPicFile should only 
be called for spooled printing.  You can tell which type of printing is to 
be used by looking at the bJDocLoop field of the prJob field of the print 
record.  Inside Mac, v. II, p. 155 shows an example in Pascal.

Note that the Postscript LaserWriters do not complain if you call 
PrPicFile.  You can get away with calling it and ignoring the error in the 
case of the Personal LaserWriter, but then you are printer-dependent since 
you cannot ignore the error if the printer is an ImageWriter.  The right 
algorithm for all Apple printer drivers is the one given in Inside Mac.

David Casseres
     Exclaimer:  Hey!