Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPrintOperationMBS class.

NSPrintOperationMBS.canSpawnSeparateThread as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Whether the receiver is allowed to spawn a separate printing thread.

canSpawnSeparateThread: True if the receiver is allowed to spawn a separate thread; otherwise, false.

If canSpawnSeparateThread is true, 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 false, 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 true, then the delegate specified in a subsequent invocation of runOperationModalForWindow may be messaged in that spawned, non-main thread.
(Read and Write computed property)

NSPrintOperationMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initialize the object the current print operation for this thread.

On success the handle property is not zero.

See also:

NSPrintOperationMBS.Constructor(other as NSPrintOperationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Special constructor to create new NSPrintOperationMBS for existing NSPrintOperationMBS object.

If you have a NSPrintOperationMBS and you want to use printOperationDidRun event, you can initialize a subclass of NSPrintOperationMBS with your existing object to get the event there.

See also:

NSPrintOperationMBS.Constructor(view as DesktopHTMLViewer, printInfo as NSPrintInfoMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 22.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates and returns an NSPrintOperation object ready to control the printing of the specified view using custom print settings.
Example
// print a HTMLViewer
dim n as new NSPrintOperationMBS(HTMLViewer1)

n.showsPrintPanel = true
n.showsProgressPanel = true
n.runOperationModalForWindow(self)

View: The view whose contents you want to print.
PrintInfo: The print settings to use when printing the view.

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

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.

See also:

NSPrintOperationMBS.Constructor(view as HTMLViewer, printInfo as NSPrintInfoMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 14.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates and returns an NSPrintOperation object ready to control the printing of the specified view using custom print settings.
Example
// print a HTMLViewer
dim n as new NSPrintOperationMBS(HTMLViewer1)

n.showsPrintPanel = true
n.showsProgressPanel = true
n.runOperationModalForWindow(self)

View: The view whose contents you want to print.
PrintInfo: The print settings to use when printing the view.

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

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.

See also:

NSPrintOperationMBS.Constructor(view as NSViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates and returns an NSPrintOperation object ready to control the printing of the specified view.

View: The view whose contents you want to print.

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

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.

See also:

NSPrintOperationMBS.Constructor(view as NSViewMBS, printInfo as NSPrintInfoMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates and returns an NSPrintOperation object ready to control the printing of the specified view using custom print settings.

View: The view whose contents you want to print.
PrintInfo: The print settings to use when printing the view.

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

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.

See also:

NSPrintOperationMBS.context as NSGraphicsMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the graphics context object used for generating output.

NSPrintOperationMBS.currentPage as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the current page number being printed.

NSPrintOperationMBS.data as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the data in PDF/EPS after the operation finished.

NSPrintOperationMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The destructor.

NSPrintOperationMBS.isCopyingOperation as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a Boolean value indicating whether the receiver is an EPS or PDF copy operation.

True if the receiver is an EPS or PDF copy operation; otherwise, false.

NSPrintOperationMBS.jobTitle as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The title of the print job.

A string containing the print job title. If set, this value overrides the title returned by the printing view.
Available in OS X v10.5 and later.
(Read and Write computed property)

NSPrintOperationMBS.pageOrder as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the print order for the pages.

The print order. For a list of possible values, see Constants.
(Read and Write computed property)

NSPrintOperationMBS.pageRange as NSRangeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the print order for the pages.

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

NSPrintOperationMBS.preferredRenderingQuality as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the printing quality.

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

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.

NSPrintOperationMBS.printInfo as NSPrintInfoMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's NSPrintInfo object.

(Read and Write computed property)

NSPrintOperationMBS.printPanel as NSPrintPanelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the NSPrintPanel object used when running the operation.

(Read and Write computed property)

NSPrintOperationMBS.runOperation as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Runs the print operation on the current thread.

Returns true if the operation was successful; otherwise, false.

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

NSPrintOperationMBS.runOperationModalForWindow(win as DesktopWindow)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 22.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Runs the print operation, calling your custom delegate method upon completion.

win: The document window to receive a print progress sheet.

Calls the printOperationDidRun event.

See also:

Some examples using this method:

NSPrintOperationMBS.runOperationModalForWindow(win as NSWindowMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Runs the print operation, calling your custom delegate method upon completion.

win: The document window to receive a print progress sheet.

Calls the printOperationDidRun event.

See also:

NSPrintOperationMBS.runOperationModalForWindow(win as window)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Runs the print operation, calling your custom delegate method upon completion.

win: The document window to receive a print progress sheet.

Calls the printOperationDidRun event.

See also:

NSPrintOperationMBS.showsPrintPanel as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Boolean value indicating whether a print panel is displayed during the operation,

True if the operation displays a print panel; otherwise, false.
Operations that generate EPS or PDF data do no display a print panel (instance of NSPrintPanel), regardless of the value returned by this method.
(Read and Write computed property)

Some examples using this property:

NSPrintOperationMBS.showsProgressPanel as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Whether the receiver displays a progress panel for this operation.

True if you want to display a progress panel; otherwise, false.
This method does not affect the display of a print panel; that operation is controlled by the ShowsPrintPanel method.
Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.
(Read and Write computed property)

Some examples using this property:

NSPrintOperationMBS.view as NSViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the view object that generates the actual data for the print operation.

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...