Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSPrintInfoMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Cocoa Printing MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: An NSPrintInfo object stores information that's used to generate printed output.
Example:
// get Xojo printer setup
dim p as new PrinterSetup

// now put it into NSPrintInfo to manipulate
dim n as new NSPrintInfoMBS
n.SetupString = p.SetupString

// change destination to file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
n.SetSaveDestination(f)

// move back
p.SetupString = n.SetupString

// and print as usual
dim g as Graphics = OpenPrinter(p)
g.DrawString "Hello World", 20, 20
Notes:
A shared NSPrintInfo object is automatically created for an application and is used by default for all printing jobs for that application.

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 Constructor 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 Class Reference for a list of types which should be stored as numbers. For other non-object values, use the NSValue class.

Beginning with OS X v10.5, to store custom information that belongs in printing presets you should use the dictionary returned by the printSettings method.

Feedback, Comments & Corrections

Pagination Modes

Constant Value Description
NSAutoPagination 0 The image is divided into equal-sized rectangles and placed in one column of pages.
NSClipPagination 2 The image is clipped to produce one column or row of pages.
NSFitPagination 1 The image is scaled to produce one column or one row of pages.

Page Orientation Constants

Constant Value Description
NSLandscapeOrientation 1 Orientation is portrait (page is taller than it is wide).
NSPortraitOrientation 0 Orientation is landscape (page is wider than it is tall).

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples which use this class:


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


NSPrinterMBS   -   NSPrintOperationMBS




Links
MBS FileMaker Plugins