Instance Method


Returns a Boolean value that indicates whether the document allows changes to the default printing information.


func shouldChangePrintInfo(_ newPrintInfo: NSPrintInfo) -> Bool



The NSPrintInfo object that is the result of the user approving the page layout panel presented by runPageLayout(_:).

Return Value

true by default; subclasses can override this method to return false.


This method is invoked by the runPageLayout(_:) method, which sets a new NSPrintInfoobject for the document only if this method returns true.

See Also

Printing the Document

var printInfo: NSPrintInfo

The printing information associated with the document.

func preparePageLayout(NSPageLayout) -> Bool

Adds document-specific content to the Page Layout panel.

func runModalPageLayout(with: NSPrintInfo, delegate: Any?, didRun: Selector?, contextInfo: UnsafeMutableRawPointer?)

Runs the modal page layout panel with the receiver’s printing information object.

func printOperation(withSettings: [NSPrintInfo.AttributeKey : Any]) -> NSPrintOperation

Creates and returns a print operation for the document's contents.

var pdfPrintOperation: NSPrintOperation

A print operation you can use to create a PDF representation of the document’s current contents.

func saveToPDF(Any?)

Exports a PDF representation of the document’s current contents.