Class

NSPrintInfo

An object that stores information that’s used to generate printed output.

Declaration

@interface NSPrintInfo : NSObject

Overview

A shared NSPrintInfo object is automatically created for an app and is used by default for all printing jobs for that app. The printing information in an NSPrintInfo object is stored in a dictionary. To access the standard attributes in the dictionary directly, this class defines a set of keys and provides the dictionary method. You can also initialize an instance of this class using the initWithDictionary: method.

You can use this dictionary to store custom information associated with a print job. Any non-object values should be stored as NSNumber or NSValue objects in the dictionary. See NSNumber for a list of types which should be stored as numbers. For other non-object values, use the NSValue class.

To store custom information that belongs in printing presets you should use the dictionary returned by the printSettings method.

Topics

Creating a Print Info Object

sharedPrintInfo

Returns the shared NSPrintInfo object.

- initWithDictionary:

Returns an NSPrintInfo object initialized with the parameters in the specified dictionary.

Managing the Printing Rectangle

bottomMargin

The height of the bottom margin.

imageablePageBounds

The imageable area of a sheet of paper specified by the receiver.

leftMargin

The width of the left margin.

orientation

The orientation attribute.

paperName

The name of the currently selected paper size.

localizedPaperName

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

paperSize

The size of the paper.

rightMargin

The width of the right margin.

topMargin

The top margin to the specified size.

Pagination

horizontalPagination

The horizontal pagination mode.

verticalPagination

the vertical pagination to the specified mode.

NSPrintingPaginationMode

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

Positioning the Image on the Page

horizontallyCentered

A Boolean value indicating whether the image is centered horizontally.

verticallyCentered

A Boolean value indicating whether the image is centered vertically.

Specifying the Printer

printer

The NSPrinter object to be used for printing.

Controlling Printing

jobDisposition

The action specified for the job.

NSPrintJobDispositionValue

These constants specify valid values for the print job attribute NSPrintJobDisposition. These constants are used the jobDisposition property.

- setUpPrintOperationDefaultValues

Validates the attributes encapsulated by the receiver.

Accessing the Print Info Dictionary

- dictionary

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

Print Settings Convenience Methods

selectionOnly

A Boolean that indicates whether only the currently selected contents should be printed.

scalingFactor

The current scaling factor.

Accessing Core Printing Information

printSettings

A mutable dictionary containing the print settings from Core Printing.

- PMPrintSession

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

- PMPageFormat

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

- PMPrintSettings

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

- updateFromPMPageFormat

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

- updateFromPMPrintSettings

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

Constants

NSPrintInfoAttributeKey

Constants for print job attributes.

NSPrintingOrientation

These constants specify page orientations used by the property orientation.

Deprecated
Page setup attributes

These constants specify dictionary keys to access page format attributes.

Pagination attributes

These constants specify dictionary keys to access pagination attributes.

Deprecated Printing Keys

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

Deprecated Methods

defaultPrinter

Deprecated.

+ setDefaultPrinter:

Deprecated.

Deprecated
+ sizeForPaperName:

Deprecated.

Deprecated

Relationships

Inherits From

Conforms To

See Also

Print Job Information

NSPrinter

An object that describes a printer’s capabilities.

NSPrintOperation

An object that controls operations that generate Encapsulated PostScript (EPS) code, Portable Document Format (PDF) code, or print jobs.