Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lunarman

macrumors newbie
Original poster
Jun 7, 2013
16
0
I am using this code to print a document:

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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.