Вопрос

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?

Это было полезно?

Решение

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.hostingViewrefers to the CorePlot hostingView.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top