[comp.sys.mac.programmer] The Printing Rectangles

casseres@apple.com (David Casseres) (06/28/90)

In article <1977@cod.NOSC.MIL> sampson@cod.NOSC.MIL (Charles H. Sampson) 
writes:
>      According to IM, the page rectangle is smaller than the paper rec-
> tangle "because of the printer's mechanical limitations."  Specifically,
> for the Imagewriter II you are not allowed to print within about a half
> an inch of the edges of the paper.  Two questions:
> 
>      (1) How do it know?  I can easily print right on top of the perfora-
> tion just by lying to the driver about where top-of-form is.  I can print
> at the left margin by shifting the paper right.  I've tried both of these
> and there doesn't seem to be any problem.  About the only thing I can't
> do is print all over the paper, because whatever I try to print is 
clipped
> to the page rectangle.  The question is ("How do it know?" is retorical):
> What is the software trying to protect us from (with so little success)?

The software assumes you have loaded the paper in a certain way, which is 
not explained very clearly in the ImageWriter manual.  It assumes the 
perforation is right at the pinch-rollers on the paper bail, and the paper 
is centered up according to the paper guide.

The horizontal limitation is that the printhead cannot traverse more than 
8 inches.  Thus the page rectangle is 8 inches wide and centered 
horizontally within the paper rectangle.

The vertical limitation has to do with not wanting to roll the paper 
backward before printing the first page, because of paper-jam problems.  
This places the top of the page rectangle an inch or so down from the top 
of the paper.  If the user selects the "no gaps between pages" option, the 
top of the page rectangle is moved up, and at the start of the job the 
printer "wastes" the first sheet of paper to place the printhead at the 
top of the page.

All the software "knows," to answer your question more specifically, is 
the paper rectangle and whether the user has selected "no gaps."  From 
this information it calculates the page rectangle.

>      (2) Does anyone have any experience with playing with these rectan-
> gles, which IM warns against doing?  For example, translating the paper
> rectangle to put its upper left corner at (0, 0) and then setting the
> page rectangle to the paper rectangle, or setting them as appropriate
> for an odd-sized piece of paper.

By using ResEdit to add a PREC 4 resource to the ImageWriter driver, and 
edit it with the PRC3 template, you can change the paper rectangle, 
specifying its size in 120ths of an inch.  But the page rectangle is 
calculated by the code, so jacking around with the print record in an 
attempt to change it is either a no-op or a cause of unknown results, 
depending on exactly when you do it.

David Casseres
     Exclaimer:  Hey!