Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Prints a document with options.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Printer | 6.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
Printer | The printer name to set. Must not match exactly, just the first letters. If empty, we use current. |
"Brother" | |
CloseDialog | Whether to close print dialog. Pass 0 to leave dialog open. Pass 1 to close by pressing OK. Pass 2 to press cancel button in case you just want to learn the options. Pass 3 to leave dialog open, but close sub dialog. |
1 | Optional |
Number of Copies | The number of copies. Leave empty to not change. |
1 | Optional |
Paper Format | The name of the paper format. Leave empty to not change. |
"A4" | Optional |
Paper Orientation | The paper orientation. Pass portrait or landscape. Empty value leaves setting as is. |
"landscape" | Optional |
Paper Source | 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" | Optional |
Pages From | The start number of page range. Pass empty text for Pages From and To to select all pages. |
1 | Optional |
Pages To | The end number of page range. Pass empty text for Pages From and To to select all pages. |
1 | Optional |
Collate Pages | Whether to collate pages. Pass 1 to enable or 0 to disable. Other values are ignored, so pass -1 or empty value to leave existing value. |
1 | Optional |
What | 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 | Optional |
PrintToFile | Available in MBS FileMaker Plugin 12.1 or newer. Whether to print to file. Pass 1 to enable or 0 to disable. Other values are ignored, so pass -1 or empty value to leave existing value. |
Optional |
Returns OK or error.
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")]
Install special print menu with print command:
# set a menu with print commands, so the print works
Install Menu Set [ “[Print]” ; Use as file default: Off ]
# now let the plugin print
Set Variable [ MBS ("printer.print") ]
# wait
Pause/Resume Script [Duration (seconds): 2]
# and restore custom menus
Install Menu Set [ “[Standard Menu]” ; Use as file default: On ]
This function is free to use.
Created 14th November 2016, last changed 10th June 2023