simple printing question
simple printing question
- Subject: simple printing question
- From: Andrew Kinnie <email@hidden>
- Date: Fri, 25 Jun 2004 20:13:28 -0400
Greetings,
I am trying to print to a receipt printer in my app I'm developing.
Basically, I am just trying to send the printer some text and have it
print without dropping the print panel. I read the apple docs, and
came up with this method from my controller method:
- (void)printReceipt:(Transaction *)transToPrint
{
NSPrintOperation *op;
NSView *view = [[NSView alloc] init];
[view insertText:[transToPrint descriptionSummary]];
op = [NSPrintOperation printOperationWithView:view];
[op setShowPanels:NO];
[op runOperation];
}
I run the app, run the method which calls this method, and I get a
dialog "No pages in the document were selected to print." The same
descriptionSummary method has it's text sent to an NSTextView, and the
text displays, so I know there is text in the document. I have not
implemented printing before, so any help would be greatly appreciated.
This is not a document based application. I'm running XCode and 10.3.4
Andrew
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.