Problems printing with WebKit
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.