Mac Developer Library

Developer

AppKit Framework Reference NSPrintInfo Class Reference

Options
Deployment Target:

On This Page
Language:

NSPrintInfo

An NSPrintInfo object stores information that’s used to generate printed output. A shared NSPrintInfo object is automatically created for an application and is used by default for all printing jobs for that application. More...

Inheritance


Conforms To


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.0 and later.
  • Returns an NSPrintInfo object initialized with the parameters in the specified dictionary.

    Declaration

    Swift

    init(dictionary aDictionary: [NSObject : AnyObject])

    Objective-C

    - (instancetype)initWithDictionary:(NSDictionary *)aDictionary

    Parameters

    aDictionary

    The possible key-value pairs contained in aDictionary are described in Constants.

    Return Value

    An initialized NSPrintInfo object, or nil if the object could not be created.

    Discussion

    This method is the designated initializer for this class. Non-object values should be stored in NSValue objects (or an appropriate subclass like NSNumber) in the dictionary. See NSNumber for a list of types which should be stored using the NSNumber class; otherwise use NSValue.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – dictionary

  • Sets the shared NSPrintInfo object to the specified object.

    Declaration

    Swift

    class func setSharedPrintInfo(_ printInfo: NSPrintInfo)

    Objective-C

    + (void)setSharedPrintInfo:(NSPrintInfo *)printInfo

    Parameters

    printInfo

    The new shared printer information. This value must not be nil.

    Discussion

    The shared NSPrintInfo object defines the settings for the NSPageLayout panel and print operations that will be used if no NSPrintInfo object is specified for those operations.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the shared NSPrintInfo object.

    Declaration

    Swift

    class func sharedPrintInfo() -> NSPrintInfo

    Objective-C

    + (NSPrintInfo *)sharedPrintInfo

    Return Value

    The shared printer information.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the height of the bottom margin.

    Declaration

    Swift

    var bottomMargin: CGFloat

    Objective-C

    @property CGFloat bottomMargin

    Return Value

    The bottom margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the imageable area of a sheet of paper specified by the receiver.

    Declaration

    Swift

    var imageablePageBounds: NSRect { get }

    Objective-C

    @property(readonly) NSRect imageablePageBounds

    Return Value

    The imageable area, measured in points in the user coordinate space.

    Discussion

    This method takes into account the current printer, paper size, and orientation settings, but not scaling factors. “Imageable area” is the maximum area that can possibly be marked on by the printer hardware, not the area defined by the current margin settings.

    The origin (0, 0) of the returned rectangle is in the lower-left corner of the oriented sheet. The imageable bounds may extend past the edges of the sheet when, for example, a printer driver specifies it so that borderless printing can be done reliably.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.2 and later.

  • Returns the width of the left margin.

    Declaration

    Swift

    var leftMargin: CGFloat

    Objective-C

    @property CGFloat leftMargin

    Return Value

    The left margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the orientation attribute.

    Declaration

    Swift

    var orientation: NSPaperOrientation

    Objective-C

    @property NSPaperOrientation orientation

    Return Value

    One of the following values: NSPortraitOrientation or NSLandscapeOrientation.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the name of the currently selected paper size.

    Declaration

    Swift

    var paperName: String!

    Objective-C

    @property(copy) NSString *paperName

    Return Value

    The string contains a value such as Letter or Legal. Paper names are implementation specific.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the human-readable name of the currently selected paper size, suitable for presentation in user interfaces.

    Declaration

    Swift

    var localizedPaperName: String! { get }

    Objective-C

    @property(readonly, copy) NSString *localizedPaperName

    Return Value

    The name of the paper size.

    Discussion

    This is typically different from the name returned by paperName, which is almost never suitable for presentation to the user.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Returns the size of the paper.

    Declaration

    Swift

    var paperSize: NSSize

    Objective-C

    @property NSSize paperSize

    Return Value

    The size of the paper, measured in points in the user coordinate space.

    Discussion

    This method is key-value observing compliant.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the width of the right margin.

    Declaration

    Swift

    var rightMargin: CGFloat

    Objective-C

    @property CGFloat rightMargin

    Return Value

    The right margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the bottom margin to the specified size.

    Declaration

    Swift

    var bottomMargin: CGFloat

    Objective-C

    @property CGFloat bottomMargin

    Parameters

    margin

    The new size for the bottom margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the left margin to the specified size.

    Declaration

    Swift

    var leftMargin: CGFloat

    Objective-C

    @property CGFloat leftMargin

    Parameters

    margin

    The new size for the left margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – leftMargin

  • Sets the page orientation to the specified value.

    Declaration

    Swift

    var orientation: NSPaperOrientation

    Objective-C

    @property NSPaperOrientation orientation

    Parameters

    orientation

    This printing orientation. See NSPrintingOrientation for possible values..

    Discussion

    For consistency, this method may change either the paper name or the paper size.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the paper name to the specified value.

    Declaration

    Swift

    var paperName: String!

    Objective-C

    @property(copy) NSString *paperName

    Parameters

    name

    The name for the paper size. The string contains a value such as Letter or Legal. Paper names are implementation specific.

    Discussion

    For consistency, this method may change either the paper size or the page orientation.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the width and height of the paper to the specified size.

    Declaration

    Swift

    var paperSize: NSSize

    Objective-C

    @property NSSize paperSize

    Parameters

    aSize

    The new size of the paper, measured in points in the user coordinate space.

    Discussion

    For consistency, this method may change either the paper name or the page orientation.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the right margin to the specified size.

    Declaration

    Swift

    var rightMargin: CGFloat

    Objective-C

    @property CGFloat rightMargin

    Parameters

    margin

    The new size for the right margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – rightMargin

  • Sets the top margin to the specified size.

    Declaration

    Swift

    var topMargin: CGFloat

    Objective-C

    @property CGFloat topMargin

    Parameters

    margin

    The new size for the top margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – topMargin

  • Returns the top margin.

    Declaration

    Swift

    var topMargin: CGFloat

    Objective-C

    @property CGFloat topMargin

    Return Value

    The top margin, measured in points in the user coordinate space.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the NSPrinter object to be used for printing.

    Declaration

    Swift

    @NSCopying var printer: NSPrinter

    Objective-C

    @property(copy) NSPrinter *printer

    Return Value

    The printer object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – setPrinter:

  • Sets the printer object used for subsequent printing jobs.

    Declaration

    Swift

    @NSCopying var printer: NSPrinter

    Objective-C

    @property(copy) NSPrinter *printer

    Parameters

    printer

    The printer object.

    Discussion

    This method iterates through the receiver's dictionary. If a feature in the dictionary is not supported by the new printer (as determined by a query to the PPD file), that feature is removed from the dictionary.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – printer

  • Returns the action specified for the job.

    Declaration

    Swift

    var jobDisposition: String

    Objective-C

    @property(copy) NSString *jobDisposition

    Return Value

    One of the following value:

    • NSPrintSpoolJob is a normal print job.

    • NSPrintPreviewJob sends the print job to the Preview application.

    • NSPrintSaveJob saves the print job to a file.

    • NSPrintCancelJob aborts the print job.

    • NSPrintFaxJob is deprecated.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the action specified for the job

    Declaration

    Swift

    var jobDisposition: String

    Objective-C

    @property(copy) NSString *jobDisposition

    Parameters

    disposition

    One of the following value:

    • NSPrintSpoolJob is a normal print job.

    • NSPrintPreviewJob sends the print job to the Preview application.

    • NSPrintSaveJob saves the print job to a file.

    • NSPrintCancelJob aborts the print job.

    • NSPrintFaxJob is deprecated.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Validates the attributes encapsulated by the receiver.

    Declaration

    Swift

    func setUpPrintOperationDefaultValues()

    Objective-C

    - (void)setUpPrintOperationDefaultValues

    Discussion

    Invoked when the print operation is about to start. Subclasses may override this method to set default values for any attributes that are not set.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the receiver’s dictionary that contains the printing attributes.

    Declaration

    Swift

    func dictionary() -> NSMutableDictionary

    Objective-C

    - (NSMutableDictionary *)dictionary

    Discussion

    The key-value pairs contained in the dictionary are described in Constants. Modifying the returned dictionary changes the receiver’s attributes.

    This dictionary is key-value observing compliant.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • isSelectionOnly isSelectionOnly Available in OS X v10.6 through OS X v10.9

    Returns whether only the currently selected contents should be printed.

    Declaration

    Objective-C

    - (BOOL)isSelectionOnly

    Return Value

    YEStrue if only the currently selected contents should be printed, otherwise NOfalse.

    Discussion

    This method is key-value observing compliant.

    Import Statement

    Availability

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

  • Returns the current scaling factor.

    Declaration

    Swift

    var scalingFactor: CGFloat

    Objective-C

    @property CGFloat scalingFactor

    Return Value

    The current scaling factor.

    Discussion

    This method is key-value observing compliant.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Sets the print info’s scaling factor.

    Declaration

    Swift

    var scalingFactor: CGFloat

    Objective-C

    @property CGFloat scalingFactor

    Parameters

    scalingFactor

    The new scaling factor.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Sets whether only the current selection should be printed.

    Declaration

    Swift

    var selectionOnly: Bool

    Objective-C

    @property(getter=isSelectionOnly) BOOL selectionOnly

    Parameters

    selectionOnly

    YEStrue if only the current selection should be printed, otherwise NOfalse.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Returns a mutable dictionary containing the print settings from Core Printing.

    Declaration

    Swift

    var printSettings: NSMutableDictionary { get }

    Objective-C

    @property(readonly, strong) NSMutableDictionary *printSettings

    Return Value

    A mutable dictionary containing the printing system’s current settings.

    Discussion

    You can use this method to get and set values from the system print settings. The keys in the returned dictionary represent the values returned by the Core Printing function PMPrintSettingsGetValue. They correspond to the settings currently in the print panel and include everything from custom values set by your accessory panels to values provided by the printer driver’s print dialog extension.

    Adding keys to the dictionary is equivalent to calling the Core Printing function PMPrintSettingsSetValue. Your new keys are added to the current print settings and are saved with any user preset files generated by the OS X printing system. Because the print settings are stored in a property list, any values you add to the dictionary must correspond to scalar types such as strings, numbers, dates, booleans, and data objects or collection types such as dictionaries and arrays.

    Other parts of the printing system use key strings like com.apple.print.PrintSettings.PMColorSyncProfileID to identify print settings. Cocoa replaces the periods in such strings with underscores. Thus, the preceding key string would be com_apple_print_PrintSettings_PMColorSyncProfileID instead. If you use reverse-DNS style key strings for your custom attributes, you should follow the same convention of using underscore characters instead of periods.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns a Core Printing object configured with the receiver’s session information.

    Declaration

    Swift

    func PMPrintSession() -> UnsafeMutablePointer<Void>

    Objective-C

    - (void *)PMPrintSession

    Return Value

    A pointer to a PMPrintSession object, an opaque type that stores information about a print job. You should not call PMRelease to release the returned object, except to balance calls to PMRetain that your code also issued.

    Discussion

    The information in the returned PMPrintSession object is consistent with the receiver’s session information at the time this method is called. Subsequent changes to the receiving NSPrintInfo object do not result in changes to the information in the PMPrintSession object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns a Core Printing object configured with the receiver’s page format information.

    Declaration

    Swift

    func PMPageFormat() -> UnsafeMutablePointer<Void>

    Objective-C

    - (void *)PMPageFormat

    Return Value

    A pointer to a PMPageFormat object, an opaque data type that stores information such as the paper size, orientation, and scale of pages in a printing session. You should not call PMRelease to release the returned object, except to balance calls to PMRetain that your code also issued.

    Discussion

    The information in the returned PMPageFormat object is consistent with the receiver’s page format information at the time this method is called. Subsequent changes to the receiving NSPrintInfo object do not result in changes to the information in the PMPageFormat object.

    If you make changes to the data in the PMPageFormat object, you should invoke the updateFromPMPageFormat method to synchronize those changes with the NSPrintInfo object that created the object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns a Core Printing object configured with the receiver’s print settings information

    Declaration

    Swift

    func PMPrintSettings() -> UnsafeMutablePointer<Void>

    Objective-C

    - (void *)PMPrintSettings

    Return Value

    A pointer to a PMPrintSettings object, an opaque data type used to store information such as the number of copies and the range of pages in a printing session. You should not call PMRelease to release the returned object, except to balance calls to PMRetain that your code also issued.

    Discussion

    The information in the returned PMPrintSettings object is consistent with the receiver’s print settings at the time this method is called. Subsequent changes to the receiving NSPrintInfo object do not result in changes to the information in the PMPrintSettings data type.

    If you make changes to the data in the PMPrintSettings object, you should invoke the updateFromPMPrintSettings method to synchronize those changes with the NSPrintInfo object that created the object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Synchronizes the receiver’s page format information with information from its associated PMPageFormat object.

    Declaration

    Swift

    func updateFromPMPageFormat()

    Objective-C

    - (void)updateFromPMPageFormat

    Discussion

    You should use this method after making changes to the PMPageFormat object obtained from the receiver. Each NSPrintInfo object keeps track of the object returned from its PMPageFormat method and obtains any updated information from the object directly. You only need to synchronize the objects once when you have made all of the desired changes.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Synchronizes the receiver’s print settings information with information from its associated PMPrintSettings object.

    Declaration

    Swift

    func updateFromPMPrintSettings()

    Objective-C

    - (void)updateFromPMPrintSettings

    Discussion

    You should use this method after making changes to the PMPrintSettings object obtained from the receiver. Each NSPrintInfo object keeps track of the object returned from its PMPrintSettings method and obtains any updated information from the object directly. You only need to synchronize the objects once when you have made all of the desired changes.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • These constants specify dictionary keys to access print job attributes.

    Declaration

    Swift

    let NSPrintPrinter: NSString! let NSPrintCopies: NSString! let NSPrintAllPages: NSString! let NSPrintFirstPage: NSString! let NSPrintLastPage: NSString! let NSPrintMustCollate: NSString! let NSPrintReversePageOrder: NSString! let NSPrintJobDisposition: NSString! let NSPrintPagesAcross: NSString! let NSPrintPagesDown: NSString! let NSPrintTime: NSString! let NSPrintDetailedErrorReporting: NSString! let NSPrintFaxNumber: NSString! let NSPrintPrinterName: NSString! let NSPrintHeaderAndFooter: NSString! let NSPrintSelectionOnly: NSString! let NSPrintJobSavingURL: NSString! let NSPrintJobSavingFileNameExtensionHidden: NSString!

    Objective-C

    NSString *const NSPrintPrinter; NSString *const NSPrintCopies; NSString *const NSPrintAllPages; NSString *const NSPrintFirstPage; NSString *const NSPrintLastPage; NSString *const NSPrintMustCollate; NSString *const NSPrintReversePageOrder; NSString *const NSPrintJobDisposition; NSString *const NSPrintSavePath; NSString *const NSPrintPagesAcross; NSString *const NSPrintPagesDown; NSString *const NSPrintTime; NSString *const NSPrintDetailedErrorReporting; NSString *const NSPrintFaxNumber; NSString *const NSPrintPrinterName; NSString *const NSPrintHeaderAndFooter; NSString *const NSPrintSelectionOnly; NSString *const NSPrintJobSavingURL; NSString *const NSPrintJobSavingFileNameExtensionHidden'

    Constants

    • NSPrintPrinter

      NSPrintPrinter

      An NSPrinter object—the printer to use.

      Available in OS X v10.0 and later.

    • NSPrintCopies

      NSPrintCopies

      An NSNumber object containing an integer—the number of copies to spool.

      Available in OS X v10.0 and later.

    • NSPrintAllPages

      NSPrintAllPages

      An NSNumber object containing a Boolean value—if YEStrue, includes all pages in output.

      Available in OS X v10.0 and later.

    • NSPrintFirstPage

      NSPrintFirstPage

      An NSNumber object containing an integer value that specifies the first page in the print job.

      Available in OS X v10.0 and later.

    • NSPrintLastPage

      NSPrintLastPage

      An NSNumber object containing an integer value that specifies the last page in the print job.

      Available in OS X v10.0 and later.

    • NSPrintMustCollate

      NSPrintMustCollate

      An NSNumber object containing a Boolean value—if YEStrue, collates output.

      Available in OS X v10.0 and later.

    • NSPrintReversePageOrder

      NSPrintReversePageOrder

      An NSNumber object containing a Boolean value—if YEStrue, prints first page last.

      Available in OS X v10.0 and later.

    • NSPrintJobDisposition

      NSPrintJobDisposition

      An NSString object that specifies the job disposition.

      NSPrintSpoolJob, NSPrintPreviewJob, NSPrintSaveJob, or NSPrintCancelJob. See setJobDisposition: for details.

      Available in OS X v10.0 and later.

    • NSPrintSavePath

      NSPrintSavePath

      An NSString object that specifies the pathname to which the job file will be saved when the jobDisposition is NSPrintSaveJob..

      Use NSPrintJobSavingURL instead.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.6.

    • NSPrintPagesAcross

      NSPrintPagesAcross

      An NSNumber object that specifies the number of logical pages to be tiled horizontally on a physical sheet of paper.

      Available in OS X v10.4 and later.

    • NSPrintPagesDown

      NSPrintPagesDown

      An NSNumber object that specifies the number of logical pages to be tiled vertically on a physical sheet of paper.

      Available in OS X v10.4 and later.

    • NSPrintTime

      NSPrintTime

      An NSDate object that specifies the time at which printing should begin.

      Available in OS X v10.4 and later.

    • NSPrintDetailedErrorReporting

      NSPrintDetailedErrorReporting

      An NSNumber object containing a Boolean value—if YEStrue, produce detailed reports when an error occurs.

      Available in OS X v10.4 and later.

    • NSPrintFaxNumber

      NSPrintFaxNumber

      An NSString object that specifies a fax number.

      Available in OS X v10.4 and later.

    • NSPrintPrinterName

      NSPrintPrinterName

      An NSString object that specifies the name of a printer.

      Available in OS X v10.4 and later.

    • NSPrintHeaderAndFooter

      NSPrintHeaderAndFooter

      An NSNumber object containing a Boolean value—if YEStrue, a standard header and footer are added outside the margins of each page.

      Available in OS X v10.4 and later.

    • NSPrintSelectionOnly

      NSPrintSelectionOnly

      An NSNumber object containing a Boolean value—if YEStrue only the current selection is printed.

      Available in OS X v10.6 and later.

    • NSPrintJobSavingURL

      NSPrintJobSavingURL

      An NSURL containing the location to which the job file will be saved when the jobDisposition is NSPrintSaveJob.

      Available in OS X v10.6 and later.

    • NSPrintJobSavingFileNameExtensionHidden

      NSPrintJobSavingFileNameExtensionHidden

      A boolean NSNumber indicating whether the job’s file name extension should be hidden when the jobDisposition is NSPrintSaveJob. The default is NOfalse.

      Available in OS X v10.6 and later.

    Import Statement

  • These constants specify the different ways in which an image is divided into pages. They’re used by horizontalPagination, setHorizontalPagination:, verticalPagination, and setVerticalPagination:.

    Declaration

    Swift

    enum NSPrintingPaginationMode : UInt { case AutoPagination case FitPagination case ClipPagination }

    Objective-C

    enum { NSAutoPagination = 0, NSFitPagination = 1, NSClipPagination = 2 }; typedef NSUInteger NSPrintingPaginationMode;

    Constants

    • AutoPagination

      NSAutoPagination

      The image is divided into equal-sized rectangles and placed in one column of pages.

      Available in OS X v10.0 and later.

    • FitPagination

      NSFitPagination

      The image is scaled to produce one column or one row of pages.

      Available in OS X v10.0 and later.

    • ClipPagination

      NSClipPagination

      The image is clipped to produce one column or row of pages.

      Available in OS X v10.0 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • These constants specify page orientations used by the methods orientation and setOrientation:.

    Declaration

    Swift

    enum NSPrintingOrientation : UInt { case PortraitOrientation case LandscapeOrientation }

    Objective-C

    enum { NSPortraitOrientation = 0, NSLandscapeOrientation = 1 }; typedef NSUInteger NSPrintingOrientation;

    Constants

    • PortraitOrientation

      NSPortraitOrientation

      Orientation is portrait (page is taller than it is wide).

      Available in OS X v10.0 and later.

    • LandscapeOrientation

      NSLandscapeOrientation

      Orientation is landscape (page is wider than it is tall).

      Available in OS X v10.0 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • These constants specify valid values for the print job attribute NSPrintJobDisposition. These constants are used by the jobDisposition and setJobDisposition: methods.

    Declaration

    Swift

    let NSPrintSpoolJob: NSString! let NSPrintPreviewJob: NSString! let NSPrintSaveJob: NSString! let NSPrintCancelJob: NSString!

    Objective-C

    NSString *const NSPrintSpoolJob; NSString *const NSPrintPreviewJob; NSString *const NSPrintSaveJob; NSString *const NSPrintCancelJob;

    Constants

    • NSPrintSpoolJob

      NSPrintSpoolJob

      Normal print job.

      Available in OS X v10.0 and later.

    • NSPrintPreviewJob

      NSPrintPreviewJob

      Send to Preview application.

      Available in OS X v10.0 and later.

    • NSPrintSaveJob

      NSPrintSaveJob

      Save to a file.

      Available in OS X v10.0 and later.

    • NSPrintCancelJob

      NSPrintCancelJob

      Cancel print job.

      Available in OS X v10.0 and later.

    Import Statement

  • These constants specify dictionary keys to access page format attributes.

    Declaration

    Swift

    let NSPrintPaperName: NSString! let NSPrintPaperSize: NSString! let NSPrintOrientation: NSString! let NSPrintScalingFactor: NSString!

    Objective-C

    NSString *NSPrintPaperName; NSString *NSPrintPaperSize; NSString *NSPrintOrientation; NSString *NSPrintScalingFactor;

    Constants

    • NSPrintPaperName

      NSPrintPaperName

      An NSString object containing the paper name.

      Available in OS X v10.0 and later.

    • NSPrintPaperSize

      NSPrintPaperSize

      An NSSize value specifying the height and width of paper in points.

      Available in OS X v10.0 and later.

    • NSPrintOrientation

      NSPrintOrientation

      An NSNumber object containing an NSPrintingOrientation.

      NSPortraitOrientation or NSLandscapeOrientation

      Available in OS X v10.0 and later.

    • NSPrintScalingFactor

      NSPrintScalingFactor

      Scale factor percentage before pagination.

      Available in OS X v10.0 and later.

    Import Statement

  • These constants specify dictionary keys to access pagination attributes.

    Declaration

    Swift

    let NSPrintLeftMargin: NSString! let NSPrintRightMargin: NSString! let NSPrintTopMargin: NSString! let NSPrintBottomMargin: NSString! let NSPrintHorizontallyCentered: NSString! let NSPrintVerticallyCentered: NSString! let NSPrintHorizontalPagination: NSString! let NSPrintVerticalPagination: NSString!

    Objective-C

    NSString *NSPrintBottomMargin; NSString *NSPrintHorizontalPagination; NSString *NSPrintHorizontallyCentered; NSString *NSPrintLeftMargin; NSString *NSPrintRightMargin; NSString *NSPrintTopMargin; NSString *NSPrintVerticalPagination; NSString *NSPrintVerticallyCentered;

    Constants

    • NSPrintLeftMargin

      NSPrintLeftMargin

      NSNumber, containing a floating-point value that specifies the left margin, in points.

      Available in OS X v10.0 and later.

    • NSPrintRightMargin

      NSPrintRightMargin

      NSNumber, containing a floating-point value that specifies the right margin, in points.

      Available in OS X v10.0 and later.

    • NSPrintTopMargin

      NSPrintTopMargin

      NSNumber, containing a floating-point value that specifies the top margin, in points.

      Available in OS X v10.0 and later.

    • NSPrintBottomMargin

      NSPrintBottomMargin

      NSNumber, containing a floating-point value that specifies the bottom margin, in points.

      Available in OS X v10.0 and later.

    • NSPrintHorizontallyCentered

      NSPrintHorizontallyCentered

      NSNumber, containing a Boolean value that is YEStrue if pages are centered horizontally.

      Available in OS X v10.0 and later.

    • NSPrintVerticallyCentered

      NSPrintVerticallyCentered

      NSNumber, containing a Boolean value that is YEStrue if pages are centered vertically.

      Available in OS X v10.0 and later.

    • NSPrintHorizontalPagination

      NSPrintHorizontalPagination

      NSNumber, containing a NSPrintingPaginationMode value.

      NSAutoPagination, NSFitPagination, or NSClipPagination. See setHorizontalPagination: for details.

      Available in OS X v10.0 and later.

    • NSPrintVerticalPagination

      NSPrintVerticalPagination

      NSNumber, containing a NSPrintingPaginationMode value.

      NSAutoPagination, NSFitPagination, or NSClipPagination. See setVerticalPagination: for details.

      Available in OS X v10.0 and later.

    Import Statement

  • These keys refer to older printing properties that are no longer used.

    Use the keys described in Print job attributes instead.

    Declaration

    Objective-C

    NSString *NSPrintFormName; NSString *NSPrintJobFeatures; NSString *NSPrintManualFeed; NSString *NSPrintPagesPerSheet; NSString *NSPrintPaperFeed; NSString *NSPrintFaxReceiverNames; NSString *NSPrintFaxReceiverNumbers; NSString *NSPrintFaxSendTime; NSString *NSPrintFaxUseCoverSheet; NSString *NSPrintFaxCoverSheetName; NSString *NSPrintFaxReturnReceipt; NSString *NSPrintFaxHighResolution; NSString *NSPrintFaxTrimPageEnds; NSString *NSPrintFaxModem; NSString *NSPrintFaxJob;

    Constants

    • NSPrintFormName

      NSPrintFormName

      Deprecated. Do not use.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.2.

    • NSPrintJobFeatures

      NSPrintJobFeatures

      Deprecated. Do not use.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.2.

    • NSPrintManualFeed

      NSPrintManualFeed

      Deprecated. Do not use.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.2.

    • NSPrintPagesPerSheet

      NSPrintPagesPerSheet

      Deprecated. Do not use.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.2.

    • NSPrintPaperFeed

      NSPrintPaperFeed

      Deprecated. Do not use.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.2.

    • NSPrintFaxReceiverNames

      NSPrintFaxReceiverNames

      Deprecated. Do not use.

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

    • NSPrintFaxReceiverNumbers

      NSPrintFaxReceiverNumbers

      Deprecated. Do not use.

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

    • NSPrintFaxSendTime

      NSPrintFaxSendTime

      Deprecated. Do not use.

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

    • NSPrintFaxUseCoverSheet

      NSPrintFaxUseCoverSheet

      Deprecated. Do not use.

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

    • NSPrintFaxCoverSheetName

      NSPrintFaxCoverSheetName

      Deprecated. Do not use.

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

    • NSPrintFaxReturnReceipt

      NSPrintFaxReturnReceipt

      Deprecated. Do not use.

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

    • NSPrintFaxHighResolution

      NSPrintFaxHighResolution

      Deprecated. Do not use.

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

    • NSPrintFaxTrimPageEnds

      NSPrintFaxTrimPageEnds

      Deprecated. Do not use.

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

    • NSPrintFaxModem

      NSPrintFaxModem

      Deprecated. Do not use.

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

    • NSPrintFaxJob

      NSPrintFaxJob

      Deprecated. Do not use.

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

    Import Statement