Printing an invisible NSView

Posted by Rodger Wilson on Stack Overflow See other posts from Stack Overflow or by Rodger Wilson
Published on 2010-03-13T11:05:11Z Indexed on 2010/03/13 11:15 UTC
Read the original article Hit count: 365

Filed under:
|
|
|
|

Initially I created a simple program with a custom NSView. I drew a picture (certificate) and printed it! beautiful! Everything worked great!

I them moved my custom NSView to an existing application. My hope was that when a user hit print it would print this certificate. Simple enough. I figured a could have a NSView pointer in my controller code. Then at initialization I would populate the pointer. Then when someone wanted to print the certificate it would print. The problem is that all of my drawing code is in the "drawRect" method. This method doesn't get called because this view is never displayed in a window.

I have heart that others use non-visible NSView objects just for printing. What do I need to do. I really don't want to show this view to the screen.

Rodger

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about xcode