[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Printing - retrieving the page
- To: MARKT@DGP.TORONTO.EDU
- Subject: Printing - retrieving the page
- From: STEVE.M@AppleLink.Apple.COM (Carbon-based, S Mitchell,APD)
- Date: 06 May 92 07:26 GMT
- Cc: BILL@CAMBRIDGE.APPLE.COM, INFO-MCL@CAMBRIDGE.APPLE.COM
To: Mark A. Tapia email@example.com
cc: Bill St. Clair
From: Steve Mitchell
Sub: Printing - retrieving the page
> I've been trying to print using the mechanism specified in
> Inside Macintosh II p156, but cannot retrive the correct
> values for the page range from the TPrint record.
The code (in your posting) shows you have not read the part
of IM you reference nearly well enough, you are even missing
sections of code it gives you.
> The record always tells me that the system will print
> 0 copies of pages 1 to 1 using draft and not spool
> printing (bjDocLoop 0).
As Bill says, "Which printer driver is selected in your
Chooser?" None perhaps?
Note to others: Apparently, if you're using MCL 2.0x and
file predates 9/13/91 you need an update.
> I tried this at home, where I only have a StyleWriter,
> and it worked as expected except that the #_PrPicFile
> call signalled an error.
_PrPicFile prints the spool file you create in the first
phase, but if you print directly to the printer (known as
draft mode), there'll be no spool file.
> Here at work, printing to a LaserWriter, it gets the
> correct values for iFstPage & iLstPage, but always
> returns 1 for iCopies and 0 for bjDocLoop.
bjDocLoop = 0 means draft mode, = 1 means spool mode.
The LaserWriter ONLY prints in draft mode, so you must
NOT call _PrPicFile! The LaserWriter (driver) always
takes care of the number of copies for you (the LW lays
out each page only once in its memory and prints it
multiply), and ALWAYS sets iCopies to 1, as Bill surmised.
When printing to the StyleWriter etc, iCopies will be
what you would expect. In draft mode you have to "image"
the page multiply as it is printed as you do so. In spool
mode however, be sure to image each page only once, as
_PrPicFile will honor iCopies and print the entire spool
file that many times. You will notice that in either mode
when you print multiple copies, you get one complete
document, then another, and so on, rather than n copies
of one page, then another set, and so on.
You should find that iFstPage & iLstPage contain the values
entered in the job dialog. For efficient printing of page
ranges that don't start with 1, it is customary to change
iLstPage to (iLstPage - iFstPage + 1) and iFstPage to 1,
and image only the pages in the range, rather than
needlessly image the pages before the first one you want
printed (this is not in Inside Mac).
You should also be sure to support Page SetUp, which the
user is supposed to bring up after switching printer
drivers in the Chooser. If you allocate the print record
yourself, instead of calling get-print-record (whatever
it does) you must call PrintDefault on it.
Once you've got this incorporated into your code (most of
it is doc'd in IM-II p151-155pp), if you still have
problems, I'd be glad to try to help further.