I am using this code to print a document:
The printing preview window shows, as expected. Try to click the cancel button. The window will not close and the app will hang.
I have a demo project here, if you want to try.
Any ideas?
Code:
NSPrintInfo *sharedPrintInfo = [NSPrintInfo sharedPrintInfo];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Untitled" ofType:@"pdf"];
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:url];
PDFView *pdfView = [[PDFView alloc] init];
[pdfView setDocument: pdfDoc];
[pdfView printWithInfo:[NSPrintInfo sharedPrintInfo] autoRotate:NO];
The printing preview window shows, as expected. Try to click the cancel button. The window will not close and the app will hang.
I have a demo project here, if you want to try.
Any ideas?