Hillegass "printing" chapter

Discussion in 'Mac Programming' started by mdeh, Feb 16, 2010.

  1. mdeh macrumors 6502

    Jan 3, 2009
    I wonder if anyone can help clarify some concepts in the chapter on printing in Hillegass. There have been very few questions about this that I can find.

    Specifically, what "imageablePageBounds" actually means.

    So, from the docs, it says this, amongst other things.

    When I look at the code generated by Hillegass, specifically:
    	NSPrintOperation *po = [NSPrintOperation currentOperation];
    	NSPrintInfo *printInfo = [po printInfo];
    	pageRect = [printInfo imageablePageBounds];
    	NSRect newFrame;
    	newFrame.origin = NSZeroPoint;
    	newFrame.size = [printInfo paperSize];
    	[self setFrame:newFrame];
    ......other code to determine range
    output for pageRect is:{{18, 40}, {576, 734}}
    and pageSize, as expected is:{612, 792}

    So, I am trying to synthesize conceptually exactly what the docs and my code means...specifically, why , for example , output for pageRect is not {{0,0}, {...,...} Any insight?


  2. Sydde macrumors 68020


    Aug 17, 2009
    Looks like ( pageRect.origin.x * 2 ) + pageRect.size.width works out to 612 - in other words, it is horizontally centered inside the printable area. I have not done any actual printing at this level, is pageRect a clipping rect?
  3. mdeh thread starter macrumors 6502

    Jan 3, 2009

    Sydde...not quite sure what you mean. But, both "views" are derived from printInfo, which, I assume is ultimately based on the User's setting of the page size, orientation etc.
  4. Sydde macrumors 68020


    Aug 17, 2009
    "Clipping" refers to limiting the drawing area. An NSClipView, forexample, is the part of an NSScrollView (a subview) that defines the visible portion of the documentView. If pageRect clips drawing, anything drawn outside of it will crop out. Clipping has been a Mac OS behavior since 1983 or so.

    From the docs, it looks like you can also set the page margins programmatically, which might make sense as a print option, as long as it makes sense for the specific printer (there are some that can actually overprint the paper, so use caution when doing this).

Share This Page