Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

Printer.Print

Prints a document with options.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Printer 6.5 No Yes No No No

MBS( "Printer.Print"; Printer { ; CloseDialog; Number of Copies; Paper Format; Paper Orientation; Paper Source; Pages From; Pages To; Collate Pages; What } )

Parameters

Parameter Description Example value
Printer The printer name to set.
Must not match exactly, just the first letters.
If empty, we use current.
"Brother"
CloseDialog Optional
Whether to close print dialog.
Pass 1 to close or 0 to not close.
Pass 2 to press cancel button in case you just want to learn the options.
1
Number of Copies Optional
The number of copies.
Leave empty to not change.
1
Paper Format Optional
The name of the paper format.
Leave empty to not change.
"A4"
Paper Orientation Optional
The paper orientation.
Pass portrait or landscape. Empty value leaves setting as is.
"landscape"
Paper Source Optional
The paper source.
Pass name of setting. Name doesn't need to match exactly, just first letters.
So you can pass "Man" für Manual (English) and Manuell (German).
"Man"
Pages From Optional
The start number of page range.
Pass empty text for Pages From and To to select all pages.
1
Pages To Optional
The end number of page range.
Pass empty text for Pages From and To to select all pages.
1
Collate Pages Optional
Whether to collate pages.
Pass 1 to enable or 0 to disable.
1
What Optional
What to print:
Pass 0 for records being browsed.
Pass 1 for current record.
Pass 2 for Blank Record showing fields.
Default is empty (or -1) to keep current setting.
0

Result

Returns OK or error.

Description

Prints a document with options.
The plugin will show the print dialog from FileMaker, automatically set options and close dialog if requested.
The function returns before the dialog shows, so please do a script pause after calling this.

You can later call Print.ErrorLog to detect errors. If Windows ever change dialogs, features may no longer work. FileMaker may not show the print dialog if there is no record available or when debugger is open.

For Mac, please check PrintDialog.Install function.

After calling this method, you can call Printer.PaperFormats, Printer.PaperSources or Printer.PrinterNames to learn what was available.

Sourcecode sponsored by schubec.com
http://www.schubec.com

Examples

Print:

Set Variable [$r; Value:MBS("Printer.Print"; Printer Dialog::Printer Name; Printer Dialog::Close Dialog; Printer Dialog::Number of Copies; Printer Dialog::Paper Format; Printer Dialog::Paper Orientation; Printer Dialog::Paper Source; Printer Dialog:…]
Pause/Resume Script [Duration (seconds): 2]
Show Custom Dialog ["Result"; MBS("Printer.ErrorLog")]

See also

Example Databases


Printer.PaperSources   -   Printer.PrinterCount

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins