Platforms to show: All Mac Windows Linux Cross-Platform

CPMPrintSessionMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Printing Mac MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
A class for a print session.
Example
// show the macOS print dialog and print one page with Core Graphics
Var session As New CPMPrintSessionMBS
Var settings As New CPMPrintSettingsMBS
Var format As New CPMPageFormatMBS
session.DefaultPrintSettings settings
session.DefaultPageFormat format

If Not session.PrintDialog(settings, format) Then Return // cancelled

session.BeginDocument(settings, format)
session.BeginPage(format, Nil)
Var g As CGContextMBS = session.PageContext
g.SetRGBFillColor(0, 0, 1)
g.FillRect CGRectMBS.Make(72, 72, 200, 100)
session.EndPage
session.EndDocument

Works only in Carbon Stuff and can only be used with CGContext which works only on Mac OS X.

Destination Types

Constant Value Description
kPMDestinationFax 3 Fax
kPMDestinationFile 2 File
kPMDestinationInvalid 0 Invalid
kPMDestinationPreview 4 Preview
kPMDestinationPrinter 1 Printer
kPMDestinationProcessPDF 5 Process to PDF
kPMDestinationTypeDefault 1 Default is printer.

This class has no subclasses.

Blog Entries

Some useful global functions for this class:

Some examples using this class:

Some related classes:


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


CPMPrinterMBS   -   CPMPrintSettingsMBS


The biggest plugin in space...