• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Crash with NSPrintOperation ?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash with NSPrintOperation ?!


  • Subject: Re: Crash with NSPrintOperation ?!
  • From: Steven Kramer <email@hidden>
  • Date: Fri, 30 Jul 2004 13:52:26 +0200

Op 29-jul-04 om 14:37 heeft Guillaume Rager het volgende geschreven:

On Wed, 28 Jul 2004 16:50:49 +0200, Steven Kramer wrote:
I've experienced the same but now have a setup that works. I think I
worked around a WebView bug and there definitely was a bug of my own
involved too ;-) Can you post some code?

Of course,

NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:[[[cachedWebView mainFrame] frameView] documentView]];
[printOperation setShowPanels:NO];

[[localPrintInfo dictionary] setObject:pathString forKey:@"NSSavePath"];

[localPrintInfo setJobDisposition:NSPrintSaveJob];
[printOperation runOperation];

The cachedWebView object is a standard WebView, but this webview is not into a window, it is just used for the page setup.


Are you sure the page has been loaded when you perform the print operation? I'm asking this, because in my setup I create the HTML when the print panel is closed (but nothing is actually printed), then wait for the webview to fully load, then re-run the print job with the options and the documentView of the newly generated HTML. It has become quite complicated but works alright now.

As a side note, one reason to do this is that I can't run the print operation with the document view straight away, because it will be replaced by a new documentview after the new page loads... I have suspicions that this causes the problem, because you will either have a lone documentview (retained by the print job, released by the webview) or there is a threading issue (I think the documentView lives mostly in another thread).

Regards

Steven
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Crash with NSPrintOperation ?!
      • From: Guillaume Rager <email@hidden>
References: 
 >Re: Crash with NSPrintOperation ?! (From: Ruben Smits <email@hidden>)
 >Re: Crash with NSPrintOperation ?! (From: Guillaume Rager <email@hidden>)
 >Re: Crash with NSPrintOperation ?! (From: Steven Kramer <email@hidden>)
 >Re: Crash with NSPrintOperation ?! (From: Guillaume Rager <email@hidden>)

  • Prev by Date: Re: [OT] was: Where is NSList? (All Threads)
  • Next by Date: Re: Getting error info when NSSocketPort initWithTCPPort fails
  • Previous by thread: Re: Crash with NSPrintOperation ?!
  • Next by thread: Re: Crash with NSPrintOperation ?!
  • Index(es):
    • Date
    • Thread