Mac Developer Library

Developer

AppKit Framework Reference NSPrintOperation Class Reference

Options
Deployment Target:

On This Page
Language:

NSPrintOperation

An NSPrintOperation object controls operations that generate Encapsulated PostScript (EPS) code, Portable Document Format (PDF) code, or print jobs. An NSPrintOperation object works in conjunction with two other objects: an NSPrintInfo object, which specifies how the code should be generated, and an NSView object, which generates the actual code.

It is important to note that the majority of methods in NSPrintOperation copy the instance of NSPrintInfo passed into them. Future changes to that print info are not reflected in the print info retained by the current NSPrintOperation object. All changes should be made to the print info before passing to the methods of this class. The only method in NSPrintOperation which does not copy the NSPrintInfo instance is setPrintInfo:.

Inheritance


Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.
  • Creates and returns a new NSPrintOperation object ready to control the copying of EPS graphics from the specified view.

    Declaration

    Swift

    class func EPSOperationWithView(_ aView: NSView, insideRect rect: NSRect, toData data: NSMutableData?) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data

    Parameters

    aView

    The view containing the data to be turned into EPS data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as EPS data.

    data

    An empty NSMutableData object. After the job is run, this object contains the EPS data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the EPS data.

    Discussion

    The new NSPrintOperation object uses the default NSPrintInfo object. This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns a new NSPrintOperation object ready to control the copying of EPS graphics from the specified view using the specified print settings.

    Declaration

    Swift

    class func EPSOperationWithView(_ aView: NSView, insideRect rect: NSRect, toData data: NSMutableData, printInfo aPrintInfo: NSPrintInfo) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo

    Parameters

    aView

    The view containing the data to be turned into EPS data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as EPS data.

    data

    An empty NSMutableData object. After the job is run, this object contains the EPS data.

    aPrintInfo

    The print settings to use when generating the EPS data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the EPS data.

    Discussion

    This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns a new NSPrintOperation object ready to control the copying of EPS graphics from the specified view and write the resulting data to the specified file.

    Declaration

    Swift

    class func EPSOperationWithView(_ aView: NSView, insideRect rect: NSRect, toPath path: String, printInfo aPrintInfo: NSPrintInfo) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo

    Parameters

    aView

    The view containing the data to be turned into EPS data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as EPS data.

    path

    The path to a file. After the job is run, this file contains the EPS data.

    aPrintInfo

    The print settings to use when generating the EPS data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the EPS data.

    Discussion

    This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns a new NSPrintOperation object ready to control the copying of PDF graphics from the specified view.

    Declaration

    Swift

    class func PDFOperationWithView(_ aView: NSView, insideRect rect: NSRect, toData data: NSMutableData) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data

    Parameters

    aView

    The view containing the data to be turned into PDF data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as PDF data.

    data

    An empty NSMutableData object. After the job is run, this object contains the PDF data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the PDF data.

    Discussion

    The new NSPrintOperation object uses the default NSPrintInfo object. This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns a new NSPrintOperation object ready to control the copying of PDF graphics from the specified view using the specified print settings.

    Declaration

    Swift

    class func PDFOperationWithView(_ aView: NSView, insideRect rect: NSRect, toData data: NSMutableData, printInfo aPrintInfo: NSPrintInfo) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo

    Parameters

    aView

    The view containing the data to be turned into PDF data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as PDF data.

    data

    An empty NSMutableData object. After the job is run, this object contains the PDF data.

    aPrintInfo

    The print settings to use when generating the PDF data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the PDF data.

    Discussion

    This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns a new NSPrintOperation object ready to control the copying of PDF graphics from the specified view and write the resulting data to the specified file.

    Declaration

    Swift

    class func PDFOperationWithView(_ aView: NSView, insideRect rect: NSRect, toPath path: String, printInfo aPrintInfo: NSPrintInfo) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo

    Parameters

    aView

    The view containing the data to be turned into PDF data.

    rect

    The portion of the view (specified in points in the view's coordinate space) to be rendered as PDF data.

    path

    The path to a file. After the job is run, this file contains the PDF data.

    aPrintInfo

    The print settings to use when generating the PDF data.

    Return Value

    The new NSPrintOperation object. You must run the operation to generate the PDF data.

    Discussion

    This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns an NSPrintOperation object ready to control the printing of the specified view.

    Declaration

    Swift

    init(view aView: NSView) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)printOperationWithView:(NSView *)aView

    Parameters

    aView

    The view whose contents you want to print.

    Return Value

    The new NSPrintOperation object. You must run the operation to print the view.

    Discussion

    The new NSPrintOperation object uses the settings stored in the shared NSPrintInfo object. This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates and returns an NSPrintOperation object ready to control the printing of the specified view using custom print settings.

    Declaration

    Swift

    init(view aView: NSView, printInfo aPrintInfo: NSPrintInfo) -> NSPrintOperation

    Objective-C

    + (NSPrintOperation *)printOperationWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo

    Parameters

    aView

    The view whose contents you want to print.

    aPrintInfo

    The print settings to use when printing the view.

    Return Value

    The new NSPrintOperation object. You must run the operation to print the view.

    Discussion

    This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the current print operation for this thread.

    Declaration

    Swift

    class func currentOperation() -> NSPrintOperation?

    Objective-C

    + (NSPrintOperation *)currentOperation

    Return Value

    The print operation object, or nil if there is no current operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the current print operation for this thread.

    Declaration

    Swift

    class func setCurrentOperation(_ operation: NSPrintOperation?)

    Objective-C

    + (void)setCurrentOperation:(NSPrintOperation *)operation

    Parameters

    operation

    The print operation to make current. You may specify nil to clear the current print operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • isCopyingOperation - isCopyingOperation Available in OS X v10.0 through OS X v10.9

    Returns a Boolean value indicating whether the receiver is an EPS or PDF copy operation.

    Declaration

    Objective-C

    - (BOOL)isCopyingOperation

    Return Value

    YEStrue if the receiver is an EPS or PDF copy operation; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 through OS X v10.9.

  • Returns the receiver’s NSPrintInfo object.

    Declaration

    Swift

    @NSCopying var printInfo: NSPrintInfo

    Objective-C

    @property(copy) NSPrintInfo *printInfo

    Return Value

    The print settings of the receiver.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the receiver’s NSPrintInfo object.

    Declaration

    Swift

    @NSCopying var printInfo: NSPrintInfo

    Objective-C

    @property(copy) NSPrintInfo *printInfo

    Parameters

    aPrintInfo

    The new print settings for the receiver.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – printInfo

  • Returns the view object that generates the actual data for the print operation.

    Declaration

    Swift

    var view: NSView? { get }

    Objective-C

    @property(readonly, strong) NSView *view

    Return Value

    The view object that generates the data.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the printing quality.

    Declaration

    Swift

    var preferredRenderingQuality: NSPrintRenderingQuality { get }

    Objective-C

    @property(readonly) NSPrintRenderingQuality preferredRenderingQuality

    Return Value

    The preferred printing quality. See NSPrintRenderingQuality for the possible values.

    Discussion

    If the print sheet is unresponsive or sluggish due to the time is takes to fully render a page, you can check this method in drawRect: and other printing methods such as beginDocument and knowsPageRage: to determine if the print operation prefers speed over fidelity. Most applications render each page fast enough and do not need to call this method. Only use this method after establishing that best quality rendering does indeed make the user interface unresponsive.

    The following is an example use of this method:

    • - (void)drawRect:(NSRect)rect {
    • NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
    • if (![currentContext isDrawingToScreen]) {
    • NSPrintOperation *printOperation = [NSPrintOperation currentOperation]
    • if ([printOperation preferredRenderingQuality] == NSPrintRenderingQualityResponsive) {
    • // Render with the best possible quality such that the user interface remains responsive
    • } else {
    • // Printing, do a full render
    • }
    • }
    • }

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Runs the print operation on the current thread.

    Declaration

    Swift

    func runOperation() -> Bool

    Objective-C

    - (BOOL)runOperation

    Return Value

    YEStrue if the operation was successful; otherwise, NOfalse.

    Discussion

    The operation runs to completion in the current thread, blocking the application. A separate thread is not spawned, even if canSpawnSeparateThread is YEStrue. Use runOperationModalForWindow:delegate:didRunSelector:contextInfo: to use document-modal sheets and to allow a separate thread to perform the operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Runs the print operation, calling your custom delegate method upon completion.

    Declaration

    Swift

    func runOperationModalForWindow(_ docWindow: NSWindow, delegate delegate: AnyObject?, didRunSelector didRunSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)runOperationModalForWindow:(NSWindow *)docWindow delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo

    Parameters

    docWindow

    The document window to receive a print progress sheet.

    delegate

    The printing delegate object. Messages are sent to this object.

    didRunSelector

    The delegate method called after the completion of the print operation.

    contextInfo

    A pointer to any data you want passed to the method in the didRunSelector parameter.

    Discussion

    The method specified by the didRunSelector parameter must have the following signature:

    • - (void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo

    The value of success is YEStrue if the print operation ran to completion without cancellation or error, and NOfalse otherwise.

    If you send setCanSpawnSeparateThread: to an NSPrintOperation object with an argument of YEStrue, then the delegate specified in a subsequent invocation of runOperationModalForWindow:delegate:didRunSelector:contextInfo: may be messaged in that spawned, non-main thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Called at the end of a print operation to remove the receiver as the current operation.

    Declaration

    Swift

    func cleanUpOperation()

    Objective-C

    - (void)cleanUpOperation

    Discussion

    You typically do not invoke this method directly.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Delivers the results of the print operation to the intended destination.

    Declaration

    Swift

    func deliverResult() -> Bool

    Objective-C

    - (BOOL)deliverResult

    Return Value

    YEStrue if the results were successfully delivered; otherwise, NOfalse.

    Discussion

    This method may be called to deliver the results to the printer spool or preview application. Do not invoke this method directly—it is invoked automatically when the print operation is done.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns a Boolean value indicating whether a print panel is displayed during the operation,

    Declaration

    Swift

    var showsPrintPanel: Bool

    Objective-C

    @property BOOL showsPrintPanel

    Return Value

    YEStrue if the operation displays a print panel; otherwise, NOfalse.

    Discussion

    Operations that generate EPS or PDF data do no display a print panel (instance of NSPrintPanel), regardless of the value returned by this method.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets whether the receiver displays a print panel for this operation.

    Declaration

    Swift

    var showsPrintPanel: Bool

    Objective-C

    @property BOOL showsPrintPanel

    Parameters

    flag

    YEStrue if you want to display a print panel; otherwise, NOfalse.

    Discussion

    This method does not affect the display of a progress panel; that operation is controlled by the setShowsProgressPanel: method.

    Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns a Boolean value indicating whether a progress panel is displayed during the operation.

    Declaration

    Swift

    var showsProgressPanel: Bool

    Objective-C

    @property BOOL showsProgressPanel

    Return Value

    YEStrue if the operation displays a progress panel; otherwise, NOfalse.

    Discussion

    Operations that generate EPS or PDF data do no display a progress panel, regardless of the value returned by this method.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets whether the receiver displays a progress panel for this operation.

    Declaration

    Swift

    var showsProgressPanel: Bool

    Objective-C

    @property BOOL showsProgressPanel

    Parameters

    flag

    YEStrue if you want to display a progress panel; otherwise, NOfalse.

    Discussion

    This method does not affect the display of a print panel; that operation is controlled by the setShowsPrintPanel: method.

    Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the title of the print job.

    Declaration

    Swift

    var jobTitle: String?

    Objective-C

    @property(copy) NSString *jobTitle

    Return Value

    A string containing the print job title. If set, this value overrides the title returned by the printing view.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Assigns a custom title to the print job.

    Declaration

    Swift

    var jobTitle: String?

    Objective-C

    @property(copy) NSString *jobTitle

    Parameters

    jobTitle

    The print job title. The receiver makes its own copy of the specified string.

    Discussion

    Assigning a title with this method overrides the job title provided by the printing view’s printJobTitle method. Specifying nil for the jobTitle parameter causes the receiver to once again take its title from the printing view.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the NSPrintPanel object used when running the operation.

    Declaration

    Swift

    var printPanel: NSPrintPanel

    Objective-C

    @property(strong) NSPrintPanel *printPanel

    Return Value

    The print panel object for the operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the NSPrintPanel object to be used during the operation.

    Declaration

    Swift

    var printPanel: NSPrintPanel

    Objective-C

    @property(strong) NSPrintPanel *printPanel

    Parameters

    panel

    The print panel object to use for the operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the graphics context object used for generating output.

    Declaration

    Swift

    var context: NSGraphicsContext? { get }

    Objective-C

    @property(readonly, strong) NSGraphicsContext *context

    Return Value

    The graphics context object used for drawing during the operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Creates the graphics context object used for drawing during the operation.

    Declaration

    Swift

    func createContext() -> NSGraphicsContext?

    Objective-C

    - (NSGraphicsContext *)createContext

    Return Value

    The graphics context object used for drawing. This object is created using the settings from the receiver's NSPrintInfo object.

    Discussion

    Do not invoke this method directly—it is invoked before any output is generated.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Destroys the receiver’s graphics context.

    Declaration

    Swift

    func destroyContext()

    Objective-C

    - (void)destroyContext

    Discussion

    Do not invoke this method directly—it is invoked at the end of a print operation.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the current page number being printed.

    Declaration

    Swift

    var currentPage: Int { get }

    Objective-C

    @property(readonly) NSInteger currentPage

    Return Value

    The current page being printed.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the range of pages associated with the print operation.

    Declaration

    Swift

    var pageRange: NSRange { get }

    Objective-C

    @property(readonly) NSRange pageRange

    Return Value

    The range of page numbers. Page numbers are one-based values where the index of page one is 1, the index of page two is 2, and so on. Depending on the information returned by the printing view, the starting page number may not be 1. Also, if the number of pages being printed is not known, the page count may be set to NSIntegerMax.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    See Also

    – knowsPageRange: (NSView)

  • Returns the print order for the pages.

    Declaration

    Swift

    var pageOrder: NSPrintingPageOrder

    Objective-C

    @property NSPrintingPageOrder pageOrder

    Return Value

    The print order. For a list of possible values, see Constants.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – currentPage

  • Sets the print order for the pages of the operation.

    Declaration

    Swift

    var pageOrder: NSPrintingPageOrder

    Objective-C

    @property NSPrintingPageOrder pageOrder

    Parameters

    order

    The print order. For a list of possible values, see Constants.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns a Boolean value indicating whether the receiver is allowed to spawn a separate printing thread.

    Declaration

    Swift

    var canSpawnSeparateThread: Bool

    Objective-C

    @property BOOL canSpawnSeparateThread

    Return Value

    YEStrue if the receiver is allowed to spawn a separate thread; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets whether the receiver is allowed to spawn a separate printing thread.

    Declaration

    Swift

    var canSpawnSeparateThread: Bool

    Objective-C

    @property BOOL canSpawnSeparateThread

    Parameters

    canSpawnSeparateThread

    YEStrue if the receiver is allowed to spawn a separate thread; otherwise, NOfalse.

    Discussion

    If canSpawnSeparateThread is YEStrue, an NSThread object is detached when the print panel is dismissed (or immediately, if the panel is not to be displayed). The new thread performs the print operation, so that control can return to your application. A thread is detached only if the print operation is run using the runOperationModalForWindow:delegate:didRunSelector:contextInfo: method. If canSpawnSeparateThread is NOfalse, the operation runs on the current thread, blocking the application until the operation completes.

    If you send setCanSpawnSeparateThread: to an NSPrintOperation object with an argument of YEStrue, then the delegate specified in a subsequent invocation of runOperationModalForWindow:delegate:didRunSelector:contextInfo: may be messaged in that spawned, non-main thread.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the type of content that the print job is printing.

    Deprecation Statement

    Use the jobStyleHint method of NSPrintPanel instead.

    Declaration

    Objective-C

    - (NSString *)jobStyleHint

    Return Value

    The content description, or nil if no job style hint has been set.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.2 and later.

    Deprecated in OS X v10.5.

  • Sets the type of content that the print job is printing.

    Deprecation Statement

    Use the setJobStyleHint: method of NSPrintPanel instead.

    Declaration

    Objective-C

    - (void)setJobStyleHint:(NSString *)hint

    Parameters

    hint

    A supported job style hint. Valid values for this parameter are described in the Constants section of the NSPrintPanel class. If this value is nil, the standard interface is used.

    Discussion

    This controls the set of items that appear in the Presets menu of the simplified Print panel interface presented by this operation, if it presents one.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.2 and later.

    Deprecated in OS X v10.5.

  • Returns the accessory view used by the receiver’s print panel.

    Deprecation Statement

    Use the accessoryControllers method of NSPrintPanel instead.

    Declaration

    Objective-C

    - (NSView *)accessoryView

    Return Value

    The custom accessory view.

    Discussion

    You use the setAccessoryView: method to customize the default NSPrintPanel object without having to subclass NSPrintPanel or specify your own print panel object.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

  • Sets the custom accessory view to be displayed by the receiver's print panel.

    Deprecation Statement

    Use the addAccessoryController: method of NSPrintPanel instead.

    Declaration

    Objective-C

    - (void)setAccessoryView:(NSView *)aView

    Parameters

    aView

    The view to display in the print panel. You can use this view to specify additional print options.

    Discussion

    You can use this method to avoid subclassing NSPrintPanel or specifying your own print panel object. The print panel is automatically resized (as needed) to accommodate the accessory view when it is selected.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

  • showPanels - showPanels (OS X v10.4) and later

    Returns a Boolean value that indicates whether the print panel is to be displayed.

    Deprecation Statement

    Use showsPrintPanel and showsProgressPanel instead.

    Declaration

    Objective-C

    - (BOOL)showPanels

    Return Value

    YEStrue if the print panel is to be displayed; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Deprecated in OS X v10.4 and later.

  • setShowPanels: - setShowPanels: (OS X v10.4) and later

    Sets whether the print operation should display a print panel.

    Deprecation Statement

    Use setShowsPrintPanel: and setShowsProgressPanel: instead.

    Declaration

    Objective-C

    - (void)setShowPanels:(BOOL)flag

    Parameters

    flag

    YEStrue if the print operation should display a print panel; otherwise, NOfalse.

    Discussion

    This method also affects whether a progress panel is presented while the operation runs. If an EPS or PDF copy operation is being performed, neither panel is displayed, regardless of the value of flag.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Deprecated in OS X v10.4 and later.

Data Types

  • These constants specify the page order.

    Declaration

    Swift

    enum NSPrintingPageOrder : Int { case DescendingPageOrder case SpecialPageOrder case AscendingPageOrder case UnknownPageOrder }

    Objective-C

    typedef enum _NSPrintingPageOrder { NSDescendingPageOrder = (-1), NSSpecialPageOrder = 0, NSAscendingPageOrder = 1, NSUnknownPageOrder = 2 } NSPrintingPageOrder;

    Constants

    • AscendingPageOrder

      NSAscendingPageOrder

      Ascending (back to front) page order.

      Available in OS X v10.0 and later.

    • DescendingPageOrder

      NSDescendingPageOrder

      Descending (front to back) page order.

      Available in OS X v10.0 and later.

    • SpecialPageOrder

      NSSpecialPageOrder

      The spooler does not rearrange pages—they are printed in the order received by the spooler.

      Available in OS X v10.0 and later.

    • UnknownPageOrder

      NSUnknownPageOrder

      No page order specified.

      Available in OS X v10.0 and later.

    Discussion

    These constants are used by pageOrder and setPageOrder:.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • This is the name of an exception that can be raised by NSPrintOperation.

    Declaration

    Swift

    var NSPrintOperationExistsException: NSString!

    Objective-C

    NSString *NSPrintOperationExistsException;

    Constants

    • NSPrintOperationExistsException

      NSPrintOperationExistsException

      The name of an exception raised when there is already a print operation in process.

      The methods that raise this exception are the EPSOperation... and printOperation....

      Available in OS X v10.0 and later.

  • These constants specify the print quality in use.

    Declaration

    Swift

    enum NSPrintRenderingQuality : Int { case Best case Responsive }

    Objective-C

    enum { NSPrintRenderingQualityBest, NSPrintRenderingQualityResponsive }; typedef NSInteger NSPrintRenderingQuality;

    Constants

    • Best

      NSPrintRenderingQualityBest

      Renders the printing at the best possible quality, regardless of speed.

      Available in OS X v10.7 and later.

    • Responsive

      NSPrintRenderingQualityResponsive

      Sacrifices the least possible amount of rendering quality for speed to maintain a responsive user interface. This option should be used only after establishing that best quality rendering does indeed make the user interface unresponsive.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.