Printing NSTextView puts text in middle of page


Printing a NSTextView centres the text (if it is less than one page in size) vertically in the page, as opposed to the top.
What do you need to do to fix this?

let tv = NSTextView()

var npo = NSPrintOperation.init(view: tv);
tv.frame.size.width = (sampleViewScroll.documentView?.frame.size.width)!;
tv.frame.size.height = 20000; // or some large number;

The attributed text (ats) is valid (displayed in a visible NSTextView).

Do I need to calculate the size of the text and set the margins?
Or is there a justification setting I am missing?


Join { to automatically receive all group messages.