• 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
Problems printing with WebKit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems printing with WebKit


  • Subject: Problems printing with WebKit
  • From: John Timmer <email@hidden>
  • Date: Mon, 29 Sep 2003 15:26:36 -0400

I'm trying to print a WebView with the following code:

- (void) printItem:(NSDictionary *) entry {
// first, create a view holding the HTML representation of the item.
[[thePrintJobView mainFrame] loadHTMLString:[exportFunctions
getHTMLFormattedExportOfRecord: entry] baseURL: nil];
}

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {

NSPrintOperation *thePrintJob = [NSPrintOperation
printOperationWithView: thePrintJobView];

[thePrintJob runOperationModalForWindow: theMainWindow delegate: nil
didRunSelector: NULL contextInfo: nil];

}

The error I get is "PMSessionEndDocumentNoDialog failed (error code =
-30879)", which appears to simply be a carbon function that ends up being
called during the print process.

The method "getHTMLFormattedExportOfRecord:" simply converts the
dictionary's contents to an HTML formatted string. I had thought that the
"didFinishLoadForFrame" method might be getting called early, but I tried
setting the view's content during window loading, and I still get the error.
I've also changed the print job to "printOperationWithView: [thePrintJobView
supeview]", and the window gets printed, so it's not a problem with the view
hierarchy.

I'm pretty much at a loss, and searching the archives and google hasn't been
helpful.

Any help would be appreciated,

JT
_______________________________________________
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: Problems printing with WebKit
      • From: Robert Borsuk <email@hidden>
References: 
 >Re: NSUserDefaults, setPersistentDomain & NSUserDefaultsDidChangeNotification (From: petite_abeille <email@hidden>)

  • Prev by Date: Re: NSBGOnly, NSUIElement & Co.?
  • Next by Date: Re: colorWithAlphaComponent: weirdness
  • Previous by thread: Re: NSUserDefaults, setPersistentDomain & NSUserDefaultsDidChangeNotification
  • Next by thread: Re: Problems printing with WebKit
  • Index(es):
    • Date
    • Thread