PDFKit.SetPrintSetting
----------------------

Sets print settings for printing PDF.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PDFKit](component_PDFKit.md) | [4.0](newinversion40.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "PDFKit.SetPrintSetting"; Selector; Value ) 

**MBS**( **"PDFKit.SetPrintSetting";** /\* Sets print settings for printing PDF. \*/  
**$Selector**; /\* Which value to set.e.g. "FaxNumber" \*/   
**$Value**) /\* The value for the setting.e.g. "+123456" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Selector | Which value to set. | "FaxNumber" |
| Value | The value for the setting. | "+123456" |

### Result

Returns OK or error.

### Description

Sets print settings for printing PDF.  
See also [PDFKit.Print](PDFKitPrint.md) function.  
All settings are optional and if not set will use default setting.  
  
Possible settings:  
| jobTitle | The title of the printing job. |
|---|---|
| faxNumber | A fax number for fax printers. This text is passed through and must match the format your driver expects. |
| PaperName | The name of the paper to use. |
| Printer | The name of the printer to use. |
| FirstPage | The number of the first page to print. |
| LastPage | The number of the last page to print. |
| Copies | The number of copies to print. Default is 1. |
| ReversePageOrder | Whether to reverse the page order. Pass 1 to reverse or 0 to not reverse. Default is not reverse. |
| MustCollate | Whether to collate or not. Pass 1 to collate or 0 to not collate. Default is 0. |
| AutoRotate | Whether to automatically rotate to match the PDF page format. Default is 1 (on). |
| ShowsPrintPanel | Whether to show the print panel. Default is 0 to not show it. Pass 1 for value to show dialog. |
| ShowsProgressPanel | Whether to show the progress panel. Default is 0 to not show it. Pass 1 for value to show progress. |
| DuplexMode | Whether to use duplex mode. Can be None (Print only on one side of sheet of paper), DuplexNoTumble (Print on both sides of the paper, with no tumbling), DuplexTumble (Print on both sides of the paper, tumbling on) or SimplexTumble (Print on only one side of the paper, but tumble the images while printing). |
| DetailedErrorReporting | Whether to enable detailed error reporting. If 1, produce detailed reports when an error occurs. |
| PagesAcross | Number of logical pages to be placed across a physical sheet. |
| PagesDown | Number of logical pages to be placed down a physical sheet. |
| TopMargin | The top margin. Default 0. |
| BottomMargin | The bottom margin. Default 0. |
| LeftMargin | The left margin. Default 0. |
| RightMargin | The right margin. Default 0. |
| HorizontalPagination | The horizontal pagination. Can be auto, clip or fit. Default is fit. |
| VerticalPagination | The vertical pagination. Can be auto, clip or fit. Default is fit. |
| scalingMode | The scaling mode to use. Default is None, but can also be DownToFit or ToFit. |
| Tray | The name of the paper tray. See [PrintDialog.GetTray](PrintDialogGetTray.md) to find the name of the tray. (New in 8.0) |
| PaperSize | The paper size in Width and Height in points for custom format. Takes 2 value parameters. |

  
You can use [PDFKit.SetPrintOption](PDFKitSetPrintOption.md) to set custom print options like with [PrintDialog.SetOption](PrintDialogSetOption.md) function.  
  
Print settings for iOS:  
| JobTitle | The job title. Default is the app name. |
|---|---|
| PrinterID | The identifier for the printer to use (when using dialog). |
| PrinterURL | The URL to identify the printer (when not using dialog). |
| ShowsPrintPanel | Whether to show the printer dialog. Default true. |
| ShowsNumberOfCopies | Whether to show number of copies option in dialog. |
| ShowsPaperSelectionForLoadedPapers | Whether to show paper selection option in dialog. |
| ShowsPaperOrientation | Whether to show orientation option in dialog. |
| OutputType | The output type to use: General, Photo, Grayscale or PhotoGrayscale. |
| DuplexMode | The duplex mode to use: None, LongEdge or ShortEdge |

### Examples

Set a fax number:

 MBS ( "PDFKit.SetPrintSetting"; "FaxNumber"; "+123456" )  
Print page 2 to 10 and make 3 copies:

 MBS ( "[PDFKit.ResetPrintSettings](PDFKitResetPrintSettings.md)" )  
MBS ( "PDFKit.SetPrintSetting"; "FirstPage"; 2 )  
MBS ( "PDFKit.SetPrintSetting"; "LastPage"; 10 )  
MBS ( "PDFKit.SetPrintSetting"; "Copies"; 3 )  
MBS ( "[PDFKit.Print](PDFKitPrint.md)" )  
Set a duplex:

 MBS ( "PDFKit.SetPrintSetting"; "DuplexMode"; "DuplexNoTumble" )  
Horizontal and vertical fit:

 $r = MBS ( "PDFKit.SetPrintSetting"; "HorizontalPagination"; "fit" )  
$r = MBS ( "PDFKit.SetPrintSetting"; "VerticalPagination"; "fit" )  
Set paper tray:

 MBS ("PDFKit.SetPrintSetting"; "Tray"; "Tray-2")  
Enable print dialog:

 MBS ( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 1 )  
Enable progress dialog:

 MBS ( "PDFKit.SetPrintSetting"; "ShowsProgressPanel"; 1 )  
Set paper size for A4:

 MBS ( "PDFKit.SetPrintSetting"; "PaperSize"; 300; 400 )  
Setup with various options:

 # set in file PDFKit Print Documents   
  
Set Variable \[ $r ; Value: MBS ( "[PDFKit.ResetPrintSettings](PDFKitResetPrintSettings.md)" ) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 0) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "ShowsProgressPanel"; 1) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "Copies"; 1) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "AutoRotate"; 1) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "scalingMode"; "ToFit") \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "PaperName"; "A5") \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "DuplexMode"; "DuplexTumble") \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "Printer"; "Laserprinter") \]  
Setup some iOS options:

 Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 0 ) \]  
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "PrinterURL"; "ipp://Laserdrucker.local.:631/ipp/print" ) \]  
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "OutputType"; "Grayscale" ) \]  
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "JobTitle"; "Test" ) \]  
Set Variable \[ $r ; Value: MBS ( "PDFKit.SetPrintSetting"; "DuplexMode"; "LongEdge" ) \]  
### See also

- [PDFKit.GetPrintLastSettings](PDFKitGetPrintLastSettings.md)
- [PDFKit.GetPrintOption](PDFKitGetPrintOption.md)
- [PDFKit.GetPrintSetting](PDFKitGetPrintSetting.md)
- [PDFKit.Print](PDFKitPrint.md)
- [PDFKit.ResetPrintSettings](PDFKitResetPrintSettings.md)
- [PDFKit.RestorePrintSettings](PDFKitRestorePrintSettings.md)
- [PDFKit.SavePrintSettings](PDFKitSavePrintSettings.md)
- [PDFKit.SetPrintOption](PDFKitSetPrintOption.md)
- [PrintDialog.GetTray](PrintDialogGetTray.md)
- [PrintDialog.SetOption](PrintDialogSetOption.md)

### Release notes

- **Version 11.1**
    - Added PageSize setting for [PDFKit.SetPrintSetting](https://www.mbsplugins.eu/PDFKitSetPrintSetting.shtml) and [PDFKit.GetPrintSetting](https://www.mbsplugins.eu/PDFKitGetPrintSetting.shtml) functions.
- **Version 10.1**
    - Fixed tray setting for [PDFKit.SetPrintSetting](https://www.mbsplugins.eu/PDFKitSetPrintSetting.shtml) function.
- **Version 8.0**
    - Added Tray setting for [PDFKit.SetPrintSetting](http://www.mbsplugins.eu/PDFKitSetPrintSetting.shtml).

### Example Databases

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

### Blog Entries

- [MBS @ FMTraining.TV - Printing in FileMaker with the MonkeyBread Plug-in](https://www.mbsplugins.de/archive/2024-04-17/MBS_@_FMTrainingTV_-_Printing_/monkeybreadsoftware_blog_filemaker)
- [Controlled printing for iOS in FileMaker](https://www.mbsplugins.de/archive/2024-04-15/Controlled_printing_for_iOS_in/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.1pr2](https://www.mbsplugins.de/archive/2021-02-05/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr5](https://www.mbsplugins.de/archive/2020-02-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.0pr8](https://www.mbsplugins.de/archive/2018-01-15/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.0pr5](https://www.mbsplugins.de/archive/2014-01-27/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2017, Seite 26](https://filemaker-magazin.de/neuigkeit/3967-Appetithappen-FMM_201706)

This function checks for a license.

Created 18th August 2014 , last changed 7th April 2024

  
[PDFKit.SetPrintOption](PDFKitSetPrintOption.md) - [PDFKit.Watermark](PDFKitWatermark.md)

[HTML Version](PDFKitSetPrintSetting.shtml)