I use below code for print view1 and when i run it, a window open and i should select settings and click on print button then the view will print.how to do it (settings) in code (means window doesn't open and directly print view1 with settings that we set in code)
NSPrintOperation *printOperation= [NSPrintOperation
printOperationWithView:view1];
[printOperation runOperation];
You can suppress the display of the
NSPrintPanelobject by sendingsetShowsPrintPanel:with a NO argument to theNSPrintOperationobject before running the operation.Just like this: