我需要知道PDFDocument的PDFView是否已经打印成功,以便做一些内务管理之后。当从NSView打印常规NSDocument时,我可以这样做
代码语言:javascript运行复制 NSPrintOperation *op = [NSPrintOperation
printOperationWithView:myRegularPrintView
printInfo:self.printInfo];
[op setCanSpawnSeparateThread:NO]; // Because we want to clean up afterwards
[op setShowsPrintPanel:YES];
[self runModalPrintOperation:op
delegate:self
didRunSelector:@selector(documentDidRunModalPrintOperation:success:contextInfo:)
contextInfo:NULL];在documentDidRunModalPrintOperation回调中,我可以做家务。但是,只有当我调用PDFView的内容时,打印内容才能正常工作。
代码语言:javascript运行复制[myPDFView printWithInfo:[NSPrintInfo sharedPrintInfo] autoRotate:YES];因此,我看不到使用回调函数运行打印操作的方法,该回调函数将在打印面板关闭时被调用。