我正在尝试打印一个简单的 NSString 值。但它给了我一个对话框说:
"Printing Now Allowed
This application is not allowed to print.
Please contact your application vendor for an update."
我使用的代码是:
-(void)printText:(NSString*)text
{
NSTextView *printView = [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0, 468, 648)];
[printView setString:text];
[[NSPrintOperation printOperationWithView:printView] runOperation];
}
有任何想法吗?