Re: oddball WebKit printing issues
Re: oddball WebKit printing issues
- Subject: Re: oddball WebKit printing issues
- From: glenn andreas <email@hidden>
- Date: Thu, 18 Jan 2007 15:31:14 -0600
On Jan 18, 2007, at 3:14 PM, Jim Thomason wrote:
(2) Even weirder, the NSPrintOperation doesn't work unless I try to
call print on the WebView itself in advance. here's the code:
[snip]
[[printView mainFrame] loadHTMLString:printString baseURL:nil];
Don't forget that WebViews don't synchronously load their pages -
this is done asynchronously (since you don't want potentially hang
your app just because the network is slow), and until it calls its
loading delegate to say that the main frame has loaded, there's
basically nothing in the page (and thus the problem you're seeing).
You'll want to implement your view as a delegate of the web view and
queue up the printing operation in the "main frame has finished
loading" callback.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build,
mutate, evolve, animate
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden