Documentation on printing in NSView, etc.


Graham Cox
 

Just after posting, a web search turned up this, which is I think what I was looking for:

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Printing/osxp_aboutprinting/osxp_aboutprt.html

But why isn’t this found using a search in the documentation browser? As I said, we’re going backwards with every Xcode release.

—Graham

On 4 Nov 2017, at 4:42 pm, Graham Cox <graham@...> wrote:

Hi all,

Can anyone link any sort of documentation that explains what all the stuff NSView does for printing does? I’m sure there used to be documentation explaining this but I just can’t find it. (And the documentation browser in Xcode 9 is even worse than the one in Xcode 8, if that were possible. How can I turn off search results pertaining to UIKit/iOS when I only want Mac-related stuff?). The documentation for the classes involved is all very well, but I need to know more than just a basic description, I need to know how it all works together.

Specifically, I have a view that is used for printing, but I’m getting very confused about how it should be set up based on NSPrintInfo, etc. As a result I’m getting multiple pages with the same content, stuff positioned incorrectly, and other annoying things that a teensy bit of documentation would no doubt solve. The basic problem is that apparently things like the -paperSize property of NSPrintInfo doesn’t contain the paper size, but the printable area, so I have to add margins, but then after adding the margins (and so the view seems to be the right size), the content ends up in the wrong place. Confusion reigns.

—Graham


Graham Cox
 

Hi all,

Can anyone link any sort of documentation that explains what all the stuff NSView does for printing does? I’m sure there used to be documentation explaining this but I just can’t find it. (And the documentation browser in Xcode 9 is even worse than the one in Xcode 8, if that were possible. How can I turn off search results pertaining to UIKit/iOS when I only want Mac-related stuff?). The documentation for the classes involved is all very well, but I need to know more than just a basic description, I need to know how it all works together.

Specifically, I have a view that is used for printing, but I’m getting very confused about how it should be set up based on NSPrintInfo, etc. As a result I’m getting multiple pages with the same content, stuff positioned incorrectly, and other annoying things that a teensy bit of documentation would no doubt solve. The basic problem is that apparently things like the -paperSize property of NSPrintInfo doesn’t contain the paper size, but the printable area, so I have to add margins, but then after adding the margins (and so the view seems to be the right size), the content ends up in the wrong place. Confusion reigns.

—Graham