Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CPMPrintSettingsMBS.Collate as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: The collate setting.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 9.3 Yes No No No No
Function: Creates a new print settings object.

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Copies as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 2.7 Yes No No No No
Function: The number of copies that the user requests to be printed.
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.CopyPrintSettings(dest as CPMPrintSettingsMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Copes the settings to the other settings.

Feedback, Comments & Corrections

CPMPrintSettingsMBS.CreateDataRepresentation(Format as Integer = 0) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Returns a data representation of a PMPageFormat object as a data string.
Example:
dim p as new CPMPrintSettingsMBS
p.Collate = true
p.Duplex = p.kPMDuplexTumble
dim data as string = p.CreateDataRepresentation
Break // check in debugger

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Dictionary as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Represent these print settings as a dictionary.

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Duplex as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: The duplex setting.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.FirstPage as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 2.7 Yes No No No No
Function: The number of the first page to print.
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.GetPageRange(byref minPage as UInt32, byref maxPage as UInt32)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Queries the page range to print.
Notes:
Obtains the valid range of pages that can be printed.
The default page range is 1 - (all pages). The page range is something that is set by the application. It is NOT the first and last page to print. It serves as limits for setting the first and last page.

Feedback, Comments & Corrections

CPMPrintSettingsMBS.JobName as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 12.1 Yes No No No No
Function: Specifies the name of a print job.
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Keys as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Queries list of keys.
Example:
dim p as new CPMPrintSettingsMBS
p.Collate = true
p.Duplex = p.kPMDuplexTumble
dim keys() as string = p.keys
Break // check in debugger

Feedback, Comments & Corrections

CPMPrintSettingsMBS.LastPage as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 2.7 Yes No No No No
Function: The number of the last page to print.
Example:
'get a print session

// print this PDF
dim pathPrinted as FolderItem=GetFolderItem("test.pdf")

dim thePrintSession as CPMPrintSessionMBS = NewCPMPrintSessionMBS
if thePrintSession = nil then Return

'get default page format and print settings and attach it to the print settings
dim thePageFormat as CPMPageFormatMBS = NewCPMPageFormatMBS
dim thePrintSettings as CPMPrintSettingsMBS = NewCPMPrintSettingsMBS
thePrintSession.DefaultPageFormat thePageFormat
thePrintSession.DefaultPrintSettings thePrintSettings

'show the print dialog
if not thePrintSession.PrintDialog(thePrintSettings,thePageFormat) then return

'open the file which will be printed
dim thePdfDocument as CGPDFDocumentMBS = pathPrinted.OpenAsCGPDFDocumentMBS

' limit page counts to the one we have
dim LastPage as Integer = thePdfDocument.PageCount
if thePrintSettings.LastPage<lastpage then
lastpage=thePrintSettings.LastPage
end if

' you get better progress bar if you tell how many pages will come
thePrintSettings.LastPage=lastpage

'begin the printing
thePrintSession.BeginDocument(thePrintSettings, thePageFormat)

'loop over the number of copies
for currentCopy as Integer = 1 to thePrintSettings.Copies

'loop over the pages
for currentPage as Integer = thePrintSettings.FirstPage to LastPage

'prepage the page
dim PrintRect as CPMRectMBS =thePageFormat.AdjustedPageSize
dim CGRect as CGRectMBS =CGMakeRectMBS(PrintRect.left, PrintRect.top, PrintRect.Width, PrintRect.Height)
thePrintSession.BeginPage(thePageFormat, nil)
dim thePrintContext as CGContextMBS = thePrintSession.PageContext
if thePrintContext = Nil then return

'print the page
thePrintContext.DrawCGPDFDocument thePdfDocument, CGRect, currentPage

'end the page
thePrintContext = nil
thePrintSession.EndPage
next

next

'end the printing
thePrintSession.EndDocument
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

CPMPrintSettingsMBS.SetPageRange(minPage as UInt32, maxPage as UInt32)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: Sets the page range to print.

Feedback, Comments & Corrections

CPMPrintSettingsMBS.Value(key as String) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Printing MBS MacCG Plugin 15.1 Yes No No No No
Function: The value in settings.
Example:
dim p as new CPMPrintSettingsMBS
p.Collate = true
dim value as Variant = p.value("com.apple.print.PrintSettings.PMCopyCollate")
Break // check in debugger
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

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





Links
MBS Xojo PDF Plugins