PDFKit.SetPrintOption
---------------------

Sets custom print options.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PDFKit](component_PDFKit.md) | [9.2](newinversion92.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "PDFKit.SetPrintOption"; Key; Value { ; Type } ) 

**MBS**( **"PDFKit.SetPrintOption";** /\* Sets custom print options. \*/  
**$Key**; /\* The key to use.e.g. "com\_apple\_print\_PrintSettings\_PMCopies" \*/   
**$Value**; /\* The value to use.  
Depending on data type, the plugin will pass a number or a text.e.g. 3 \*/   
**$Type**) /\* Optional; 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 boolean, text, number, integer and text.  
Integer is for integer numbers while number is for floating numbers. \*/ 

### 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 | 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 boolean, text, number, integer and text.   Integer is for integer numbers while number is for floating numbers. |  | Optional      Added in version **9.2**. |

### Result

Returns OK or error.

### Description

Sets custom print options.  
For regular options, please use [PDFKit.SetPrintSetting](PDFKitSetPrintSetting.md).  
### Examples

Sets a custom option:

 MBS ( "PDFKit.SetPrintOption"; "xxx"; 123 )  
Sets a custom boolean option:

 MBS ( "PDFKit.SetPrintOption"; "xxx"; 1; "boolean" )  
Asks for 4 pages per page:

 Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintOption"; "NSPagesAcross"; 2; "Integer") \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintOption"; "NSPagesDown"; 2; "Integer") \]  
Set output bin:

 Set Variable \[ $r ; Value: MBS ("PDFKit.SetPrintOption"; "OutputBin"; "MailBoxBin1") \]  
### See also

- [PDFKit.GetPrintOption](PDFKitGetPrintOption.md)
- [PDFKit.GetPrintSetting](PDFKitGetPrintSetting.md)
- [PDFKit.SetPrintSetting](PDFKitSetPrintSetting.md)

### Release notes

- **Version 11.5**
    - Fixed a problem with [PDFKit.SetPrintOption](https://www.mbsplugins.eu/PDFKitSetPrintOption.shtml) not setting value correctly.
- **Version 9.2**
    - Added new optional type parameter to [PrintDialog.SetOption](http://www.mbsplugins.eu/PrintDialogSetOption.shtml) and [PDFKit.SetPrintOption](http://www.mbsplugins.eu/PDFKitSetPrintOption.shtml) to set data type.
    - Added [PDFKit.GetPrintOption](http://www.mbsplugins.eu/PDFKitGetPrintOption.shtml) and [PDFKit.SetPrintOption](http://www.mbsplugins.eu/PDFKitSetPrintOption.shtml) functions to set custom options.

### Example Databases

- [Mac and iOS/PDFKit/Print PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/Print%20PDF.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.5pr1](https://www.mbsplugins.de/archive/2021-10-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Was gibt es neues bei MBS Version 9.2](https://www.mbsplugins.de/archive/2019-07-16/Was_gibt_es_neues_bei_MBS_Vers/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.2pr1](https://www.mbsplugins.de/archive/2019-04-02/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd March 2019 , last changed 10th April 2022

  
[PDFKit.SetPDFPageRotation](PDFKitSetPDFPageRotation.md) - [PDFKit.SetPrintSetting](PDFKitSetPrintSetting.md)

[HTML Version](PDFKitSetPrintOption.shtml)