Hi,
I am trying to get the document view from a webview for printing and I always get nil returned. Here is my code:
//BEGIN CODE
[[_webView mainFrame] loadHTMLString:html baseURL:nil];
[[self window] makeKeyAndOrderFront:nil];
[_webView print:nil];
NSView *documentView = [[[_webView mainFrame] frameView] documentView];
//documentView is nil!?
NSPrintOperation *op = [NSPrintOperation printOperationWithView:documentView];
[op runOperation];
//END CODE
_webView is an outlet that is hooked up to a webview in IB and if I display the window, the webview shows the correct HTML rendering.
Anyone have any suggestions? I am sure I am just over-looking something obvious.