Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPrintInfoMBS class.

NSPrintInfoMBS.bottomMargin as Double

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 bottom margin, measured in points in the user coordinate space.

(Read and Write property)

NSPrintInfoMBS.data as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 14.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Query or set the current settings as data.
Example
// print to PDF in Xojo Cocoa app

// change print info to go to
dim s as NSPrintInfoMBS = NSPrintInfoMBS.sharedPrintInfo
dim d as MemoryBlock = s.data // save old
s.SetSaveDestination SpecialFolder.Desktop.Child("test.pdf")

// now print something
dim g as Graphics = OpenPrinter
if g<>Nil then
g.DrawString "Hello World PDF", 20, 20
end if


s.data = d // restore original settings

// now print something to regular printer
g = OpenPrinter
if g<>Nil then
g.DrawString "Hello World Printer", 20, 20
end if

The plugin archives the current settings and you can later assign them back.
(Read and Write property)

NSPrintInfoMBS.dictionary as dictionary

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 dictionary that contains the printing attributes.

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.
(Read and Write property)

NSPrintInfoMBS.Handle 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
The internal object reference.

(Read and Write property)

NSPrintInfoMBS.HorizontallyCentered 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 image is centered horizontally.

True if you want the image to be centered horizontally; otherwise, false.
(Read and Write property)

Some examples using this property:

NSPrintInfoMBS.horizontalPagination 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
The horizontal pagination to the specified mode.

One of the pagination modes described in constants.
(Read and Write property)

Some examples using this property:

NSPrintInfoMBS.imageablePageBounds as NSRectMBS

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 imageable area of a sheet of paper specified by the receiver.

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

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.
(Read only property)

NSPrintInfoMBS.jobDisposition 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 action specified for the job.

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.
(Read and Write property)

NSPrintInfoMBS.leftMargin as Double

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 left margin to the specified size.

The size for the left margin, measured in points in the user coordinate space.
(Read and Write property)

NSPrintInfoMBS.localizedPaperName 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
Returns the human-readable name of the currently selected paper size, suitable for presentation in user interfaces.

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

NSPrintInfoMBS.orientation 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
The page orientation to the specified value.

This printing orientation. See constants for possible values.
For consistency, this method may change either the paper name or the paper size.
(Read and Write property)

NSPrintInfoMBS.paperName 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 paper name to the specified value.

The name for the paper size. The string contains a value such as Letter or Legal. Paper names are implementation specific.
For consistency, this method may change either the paper size or the page orientation.
(Read and Write property)

NSPrintInfoMBS.paperSize as NSSizeMBS

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 width and height of the paper to the specified size.

The new size of the paper, measured in points in the user coordinate space.
For consistency, this method may change either the paper name or the page orientation.
(Read and Write property)

NSPrintInfoMBS.printer as NSPrinterMBS

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 printer object used for subsequent printing jobs.

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.
(Read and Write property)

Some examples using this property:

NSPrintInfoMBS.printerName as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The printer name of printer used for subsequent printing jobs.

(Read only property)

NSPrintInfoMBS.printSettings as dictionary

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 a mutable dictionary containing the print settings from Core Printing.

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

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.
(Read only property)

NSPrintInfoMBS.rightMargin as Double

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 right margin to the specified size.

The size for the right margin, measured in points in the user coordinate space.
(Read and Write property)

NSPrintInfoMBS.scalingFactor as Double

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 print info's scaling factor.

Default is 1.0.
Using smaller value increases paper size.
(Read and Write property)

NSPrintInfoMBS.SelectionOnly 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 only the current selection should be printed.

True if only the current selection should be printed, otherwise false.
(Read and Write property)

NSPrintInfoMBS.SetupString as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Printing MBS MacCocoa Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Query or set the current settings as data.
Example
// start with a printer setup
dim p as new PrinterSetup

// clone to NSPrintInfo
dim info as new NSPrintInfoMBS(p.SetupString)

// find out what name second printer has
dim printers() as string = NSPrinterMBS.printerNames
dim printer as NSPrinterMBS = NSPrinterMBS.printerWithName(printers(1))
System.DebugLog printers(1)

// now set a new paper size and this printer
info.paperSize = new NSSizeMBS(72*5, 72*6) // 5 by 6 inch
info.printer = printer

// and clone back
p.SetupString = info.SetupString

// now print to this printer with this paper
dim g as Graphics = OpenPrinter(p)

g.DrawString "Hello", 10, 10

While data property encodes the dictionary, this property encodes the NSPrintInfo which is same format as PrinterSetup.SetupString in Xojo.
(Read and Write property)

NSPrintInfoMBS.topMargin as Double

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 top margin, measured in points in the user coordinate space.

The size for the top margin, measured in points in the user coordinate space.
(Read and Write property)

NSPrintInfoMBS.VerticallyCentered 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 image is centered vertically.

True if you want the image to be centered vertically; otherwise, false.
(Read and Write property)

Some examples using this property:

NSPrintInfoMBS.verticalPagination 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
The vertical pagination mode.

One of the pagination modes described in constants.
(Read and Write property)

Some examples using this property:

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


The biggest plugin in space...