In OS X 10.9, Apple introduced a simple way to export user content as PDF. The menu item called 'Export as PDF' is used to present a save sheet to export the data. (A example for this is Safari)
In its WWDC Videos Apple showed how it works, but my solution doesn't seem to be right.
I am using a non-document based app.
I have managed to get the save sheet so far, but with my current code, I get the print sheet as well after that. Furthermore, no data is saved so far.
Here is my code:
NSPrintOperation* printOP = [NSPrintOperation printOperationWithView:_textView];
printOP.printInfo.jobDisposition = NSPrintSaveJob;
[printOP runOperationModalForWindow:_window
delegate:nil didRunSelector:nil contextInfo:nil];
What am I doing wrong?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…