• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
simple printing question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: simple printing question
      • From: Peter Borg <email@hidden>
  • Prev by Date: Re: Authenticating without UI
  • Next by Date: One for the Unix gurus
  • Previous by thread: Re: Online Version Checking
  • Next by thread: Re: simple printing question
  • Index(es):
    • Date
    • Thread