WebView.SetPrintParameter
-------------------------

Sets print parameters for [WebView.Print](WebViewPrint.md) method.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [2.1](newinversion21.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.SetPrintParameter"; ParameterName; ParameterValue ) 

**MBS**( **"WebView.SetPrintParameter";** /\* Sets print parameters for Webview.Print method. \*/  
**$ParameterName**; /\* The name of the parameter.   
For MacOS, can be horizontallyCentered, verticallyCentered, showPrintPanel, orientation, printer, bottomMargin, topMargin, leftMargin or rightMargin.e.g. orientation \*/   
**$ParameterValue**) /\* The value for the given parameter: A boolean value for horizontallyCentered, verticallyCentered and showPrintPanel. "portrait" or "landscape" for orientation. The printer name for printer. A number for bottomMargin, topMargin, leftMargin or rightMargin.e.g. portrait \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ParameterName | The name of the parameter.    For MacOS, can be horizontallyCentered, verticallyCentered, showPrintPanel, orientation, printer, bottomMargin, topMargin, leftMargin or rightMargin. | orientation |
| ParameterValue | The value for the given parameter: A boolean value for horizontallyCentered, verticallyCentered and showPrintPanel. "portrait" or "landscape" for orientation. The printer name for printer. A number for bottomMargin, topMargin, leftMargin or rightMargin. | portrait |

### Result

Returns OK or an error message.

### Description

Sets print parameters for [WebView.Print](WebViewPrint.md) method.   
If showPrintPanel (Default 1) if set to 0, then no print window is shown. verticallyCentered and horizontallyCentered define if content is centered. If printer name is not valid, it will be ignored.  
  
Parameters for iOS:   
- Duplex: None, LongEdge or ShortEdge,
- OutputType: General, Photo, Grayscale or PhotoGrayscale,
- JobName and
- Orientation: Portrait or Landscape.

Parameters for Windows with Edge:   
- Orientation: Portrait or Landscape.
- ShouldPrintBackgrounds,
- PaperWidth,
- PaperHeight,
- BottomMargin,
- TopMargin,
- LeftMargin,
- RightMargin,
- ShouldPrintHeaderAndFooter: 1 or 0,
- ShouldPrintSelectionOnly: 1 or 0,
- HeaderTitle and
- FooterUri
- PageRanges
- PrinterName
- PagesPerSide
- Copies
- Collation
- ColorMode
- Duplex

Parameters for macOS with WebKit 2:   
- HorizontallyCentered,
- VerticallyCentered,
- ShowPrintPanel,
- Orientation: Portrait or Landscape.
- PaperName,
- Printer,
- PaperWidth,
- PaperHeight,
- BottomMargin,
- TopMargin,
- LeftMargin,
- RightMargin,
- ShouldPrintBackgrounds and
- MinimumFontSize.

Orientation can be portrait or landscape.   
Margins are in points (at 72 dpi).  
  
For Windows:  
HeaderTitle: The default value is the title of the current document. If an empty string or null value is provided, no title is shown in the header.  
FooterURI: The default value is the current URI. If an empty string or null value is provided, no URI is shown in the footer.  
Collation: 0 for default, 1 for collated and 2 for uncollated.  
Duplex: 0 for default, 1 for one sided, 2 for two sided and long edge, 3 for two sided and short edge.  
ColorMode: 0 for default, 1 for color and 2 for gray.  
  
Use [WebView.GetPrintParameter](WebViewGetPrintParameter.md) to query values.  
### Examples

Sets bottom margin to 5 points:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "bottomMargin"; 5) \]  
Use square paper size:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "paperWidth"; 800)\]  
Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "paperHeight"; 800)\]  
Use A4 paper on macOS:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "paperName"; "iso-a4") \]  
Set landscape:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "orientation"; "landscape") \]  
Set portrait:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "orientation"; "portrait") \]  
The paper size to match A4:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "paperWidth"; 576) \]  
Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "paperHeight"; 842) \]  
Ask to print backgrounds:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "ShouldPrintBackgrounds"; 1) \]  
Ask to save ink by not print backgrounds:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "ShouldPrintBackgrounds"; 0) \]  
Ask to print only selection:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "ShouldPrintSelectionOnly"; 1) \]  
Ask to print header and footer:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "ShouldPrintHeaderAndFooter"; 1) \]  
Custom header and footer on Windows:

 Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "ShouldPrintHeaderAndFooter"; 1) \]  
Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "HeaderTitle"; "Hello World") // default is website title \]  
Set Variable \[ $r ; Value: MBS ("WebView.SetPrintParameter"; "FooterUri"; "https://www.mbsplugins.de") // default is website URI \]  
### See also

- [WebView.ClearPrintParameters](WebViewClearPrintParameters.md)
- [WebView.Create](WebViewCreate.md)
- [WebView.GetPrintParameter](WebViewGetPrintParameter.md)
- [WebView.Print](WebViewPrint.md)
- [WebView.PrintToFile](WebViewPrintToFile.md)

### Release notes

- **Version 16.3**
    - Added PageRanges, PrinterName, PagesPerSide, Copies, Collation, ColorMode and Duplex parameters for WebView.SetPrintParameter function on Windows.
- **Version 16.1**
    - Added HeaderTitle, FooterUri, ShouldPrintHeaderAndFooter and ShouldPrintSelectionOnly as options for [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) for Windows.
    - Added OutputType and Duplex as options for [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) for iOS.
- **Version 15.1**
    - Fixed [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) to use points in 72 dpi instead of inches for paper size and margins.
- **Version 14.1**
    - Added support for orientation in [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) function for iOS.
- **Version 13.2**
    - Added [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) and [WebView.GetPrintParameter](https://www.mbsplugins.eu/WebViewGetPrintParameter.shtml) for Windows with this parameters: paperWidth, paperHeight, bottomMargin, topMargin, leftMargin, rightMargin, orientation and shouldPrintBackgrounds.
- **Version 13.1**
    - Added shouldPrintBackgrounds parameter for [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) for use in WebKit 1 and 2.
- **Version 10.3**
    - Added iOS support for [WebView.SetPrintParameter](https://www.mbsplugins.eu/WebViewSetPrintParameter.shtml) and [WebView.GetPrintParameter](https://www.mbsplugins.eu/WebViewGetPrintParameter.shtml). Currently only supporting JobName and Orientation as settings.

### Example Databases

- [WebViewer/WebViewer Save PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Save%20PDF.shtml#8ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr1](https://www.mbsplugins.de/archive/2026-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 16.1 for Claris FileMaker - More than 7800 functions in one plugin](https://www.mbsplugins.de/archive/2026-03-17/MBS_FileMaker_Plugin_161_for_C/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 16.1pr5](https://www.mbsplugins.de/archive/2026-03-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.1pr1](https://www.mbsplugins.de/archive/2025-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 14.1 for Claris FileMaker](https://www.mbsplugins.de/archive/2024-03-12/MBS_Plugin_141_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Printing a WebViewer in FileMaker](https://www.mbsplugins.de/archive/2024-02-16/Printing_a_WebViewer_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.2 for Claris FileMaker](https://www.mbsplugins.de/archive/2023-05-09/MBS_Plugin_132_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Print web viewer on iOS](https://www.mbsplugins.de/archive/2020-07-14/Print_web_viewer_on_iOS/monkeybreadsoftware_blog_filemaker)
- [Print WebViewer on macOS in FileMaker](https://www.mbsplugins.de/archive/2017-11-28/Print_WebViewer_on_macOS_in_Fi/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.1 final candidate](https://www.mbsplugins.de/archive/2010-10-22/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2024, Seite 32](https://filemaker-magazin.de/neuigkeit/4263-Appetithappen-FMM_202403)

This function checks for a license.

Created 18th August 2014 , last changed 11st May 2026

  
[WebView.SetPreferences](WebViewSetPreferences.md) - [WebView.SetPrivateBrowsing](WebViewSetPrivateBrowsing.md)

[HTML Version](WebViewSetPrintParameter.shtml)