Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
PrintDialog.SetOption
Sets an option.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
PrintDialog | 6.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Key | The key to use. | "com_apple_print_PrintSettings_PMCopies" | |
Value | The value to use. Depending on data type, the plugin will pass a number or a text. |
3 | |
Type | Available in MBS FileMaker Plugin 9.2 or newer. The type of data to add. Default is empty to use type of value passed. So text or number type would be picked automatically. Valid values for type are text, number, integer and text. Integer is for integer numbers while number is for floating numbers. |
Optional |
Result
Returns OK or error.
Description
Sets an option.You can use PrintDialog.GetLastSettings after printing to query XML with all settings and pick keys and values.
When you are done after printing, you may use PrintDialog.ClearOptions to clear options for next print.
Examples
Set copies to 3 via options:
MBS("PrintDialog.SetOption"; "com_apple_print_PrintSettings_PMCopies"; 3)
Set border to double hairline:
MBS("PrintDialog.SetOption"; "com_apple_print_PrintSettings_PMBorderType"; 2)
Set border to single hairline:
MBS("PrintDialog.SetOption"; "com_apple_print_PrintSettings_PMBorderType"; 1)
Set duplex binding:
MBS("PrintDialog.SetOption"; "com_apple_print_PrintSettings_PMDuplexing"; 2) &
MBS("PrintDialog.SetOption"; "DuplexBindingEdge"; 2)
Set input slot and output bin:
MBS("PrintDialog.SetOption"; "InputSlot"; "4Tray") &
MBS("PrintDialog.SetOption"; "OutputBin"; "MailBoxBin7")
# those keys and values are print driver dependent and hand picked from configuration XML.
Set media type and quality for a HP printer:
// Set Variable [ $r ; Value: MBS( "PrintDialog.SetOption"; "MediaType"; "com.hp.rough") ]
// Set Variable [ $r ; Value: MBS( "PrintDialog.SetOption"; "cupsPrintQuality"; "Draft") ]
Set Variable [ $r ; Value: MBS( "PrintDialog.SetOption"; "MediaType"; "com.hp.recycled") ]
Set Variable [ $r ; Value: MBS( "PrintDialog.SetOption"; "cupsPrintQuality"; "Normal") ]
See also
- PDFKit.SetPrintSetting
- PrintDialog.ClearOption
- PrintDialog.ClearOptions
- PrintDialog.GetCopies
- PrintDialog.GetLastSettings
- PrintDialog.GetOption
- PrintDialog.SetCopies
- PrintDialog.SetDuplex
- PrintDialog.SetNoDialog
- PrintDialog.SetReverseOrder
Release notes
- Version 9.2
- Added new optional type parameter to PrintDialog.SetOption and PDFKit.SetPrintOption to set data type.
Blog Entries
- Control printing in FileMaker with MBS Plugin on MacOS
- New in MBS FileMaker Plugin 11.0
- MBS FileMaker Plugin, version 9.2pr1
- MBS FileMaker Plugin 6.2 for OS X/Windows
- MBS FileMaker Plugin, version 6.2pr7
FileMaker Magazin
This function checks for a license.
Created 30th April 2016, last changed 13th January 2024
PrintDialog.SetNoDialog - PrintDialog.SetPageNumberingOffset