Printing Methods – Mac

This page is referenced from Printing Methods.

Whereas Linux via such packages as kprinter and gtklp can be "passed" files to present to the user for additional options prior to printing (or even cancelling the print job), the Mac provides no such package.

A tiny, developed-for-purpose application (in Cocoa) could be created to do this, and would likely take a Mac developer half a day or a day depending on their background.

In the meantime, options include:

  • directing the output straight to whatever is each Mac user's default network (CUPS) printer
  • modifying the control file's lpr command on a per-machine, or per-machine system account user level
  • substituting, in place of the lp or lpr command, one redirecting the file (for example a PDF) into the Apple's 'Preview" application:
    • # open -a Preview or
    • # osascript -e 'tell application "Preview" to open ((POSIX file "fullySpecifiedFilenameInQuotes") as text)'

Apple Script

Cocoa PDE with Carbon Printing


fax from command line or apple script

code snippets that I've sent to other developers
I don't know about MacApp but the PrintCore framework has NoDialog variants of the standard print loop APIs that enable applications to print without showing a progress dialog -- PMSessionBeginDocumentNoDialog(), PMSessionBeginPageNoDialog(), PMSessionEndPageNoDialog, PMSessionEndDocumentNoDialog().

The PrintCore framework has PMServerCreatePrinterList() that returns a list of printers and PMPrinterGetID() to get the unique queue id. In Panther we handle multiple printers of the same model on the USB bus so your app should be able to identify each printer.

cupstestppd command?


Topic revision: 14 Jan 2010, JamesBusser
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark