Reputation: 2312
I'm trying to print an NSView which includes a couple coreplot piecharts among other items. However the piecharts do not appear. I now understand that layer backed views do not print, but I'm having difficultly locating any examples where people circumvented this and printed coreplot graphs within a NSView. What is the best approach for this?
Upvotes: 1
Views: 181
Reputation: 4660
For me it worked as soon as I have set-up the printRect like:
NSRect printRect = NSZeroRect;
printRect.size.width = (printInfo.paperSize.width - printInfo.leftMargin - printInfo.rightMargin) * printInfo.scalingFactor;
printRect.size.height = (printInfo.paperSize.height - printInfo.topMargin - printInfo.bottomMargin) * printInfo.scalingFactor;
self.hostingView.printRect = printRect;
op = [NSPrintOperation printOperationWithView:self.hostingView printInfo:printInfo];
Note self.hostingView
refers to the CorePlot hostingView.
Upvotes: 2