• 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
Re: Bypassing the print dialog box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bypassing the print dialog box


  • Subject: Re: Bypassing the print dialog box
  • From: Robert Cerny <email@hidden>
  • Date: Tue, 29 Jul 2003 19:36:07 +0200

Hi,
1.
NSPrintOperation *op = [NSPrintOperation printOperationWithView:aView
printInfo:printInfo];
[op setShowPanels:NO];
[op runOperation];

2. You could simply provide another menu item with a key equivalent like, Print One Copy
3. YES


HTH
Robert

On Tuesday, July 29, 2003, at 05:30 PM, Ken Tabb wrote:

Hi folks,
here's a potentially weird one which breaks the Aqua UI Guidelines (don't shoot me):

[1] I have an Obj-C app which has a view that needs to be printed, but it needs to be printed *without* offering the user a print dialog box (I know they only want 1 copy, and the document is only 1 page long). i.e. they hit "Print" and it prints. No ifs or buts. How do I do this?

[2] Is it possible to do this while still having a normal print dialog available (eg. to set the app up in the first place / choose another printer when one of the printers dies). I'm guessing I could divert Cmd-P to the method which prints direct, and make Cmd-Shift-P bring up the usual print dialog box.

[3] If they print direct (without dialog box), the job still appears in Print Center etc., correct? So if there's an "out of paper" situation, they can still re-run the job from Print Center etc. as normal?

The app in question is printing a receipt to a thermal printer (those toilet roll printers that your credit/debit card receipts come on), so the user (the admin bod here at the Uni) will always want 1 receipt printed. Speed of processing is crucial to the app, hence don't want superfluous dialogs appearing, and the <usually vacant> admin bod accidentally typing the credit card number into the "number of copies" textfield 8^)

Thanks in advance for any help you can give, sorry for breaking UI rules this once. It won't happen again,
Ken
Aqua UI Rebel

p.s. There's the facility to retrospectively print another copy of the receipt, in case you think my "they'll only want 1 copy printed" statement is assuming too much.

- - - - - - - - - -
Ken Tabb
Mac & UNIX Technical bloke (C, C++, Obj-C, Java) - Health & Human Sciences
Machine Vision & Neural Network researcher bloke - Computer Science Dept
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/

Certified non-Microsoft Solution Provider
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Bypassing the print dialog box (From: Ken Tabb <email@hidden>)

  • Prev by Date: Custom Sheets
  • Next by Date: NSTask vs. BSD API (was: Talking to the Dock)
  • Previous by thread: Bypassing the print dialog box
  • Next by thread: Panther questions ?
  • Index(es):
    • Date
    • Thread