WebView.Screenshot
------------------

Takes a screenshot of the area used by the WebViewer.

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

MBS( "WebView.Screenshot"; WebViewerRef { ; ImageType; FileName } ) 

**MBS**( **"WebView.Screenshot";** /\* Takes a screenshot of the area used by the WebViewer. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$ImageType**; /\* Optional; The type of image to return.   
Either JPEG, PNG, GIF or BMP. Default is JPEG.e.g. "JPEG" \*/   
**$FileName**) /\* Optional; The filename to use for the picture.   
Default is "image" with the extension matching the image type.e.g. "test.jpg" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |  |
| ImageType | The type of image to return.    Either JPEG, PNG, GIF or BMP. Default is JPEG. | "JPEG" | Optional |
| FileName | The filename to use for the picture.    Default is "image" with the extension matching the image type. | "test.jpg" | Optional |

### Result

Returns image for storing in container.

### Description

Takes a screenshot of the area used by the WebViewer.  
The plugin offers several methods. [WebView.RenderImage](WebViewRenderImage.md) works fine on Mac, but not always on Windows. [WebView.RenderPDF](WebViewRenderPDF.md) is Mac only. So especially for websites with flash or other content which can't be printed, the screenshot method is the best one.  
(older versions before 5.2 would have an unused extra parameter before ImageType)  
Windows only supports JPEG as type.  
  
Added iOS support for version 8.5.  
  
On Windows may get wrong rectangle if Windows runs desktop with 200% resolution, but you have a 100% resolution screen.  
  
For Windows and FileMaker 19.3, you can use [Container.Screenshot](ContainerScreenshot.md) function instead.  
### Examples

Store screenshot in container:

 Set Variable \[$image ; Value:MBS ("WebView.Screenshot"; "web")\]  
Set Field \[Anlagen::My Container; $image \]  
### See also

- [Container.Screenshot](ContainerScreenshot.md)
- [MapView.Screenshot](MapViewScreenshot.md)
- [Screenshot](Screenshot.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.RenderImage](WebViewRenderImage.md)
- [WebView.RenderPDF](WebViewRenderPDF.md)
- [Window.Screenshot](WindowScreenshot.md)

### Release notes

- **Version 13.1**
    - Fixed ScreenshotRect, [Container.Screenshot](https://www.mbsplugins.eu/ContainerScreenshot.shtml) and [WebView.Screenshot](https://www.mbsplugins.eu/WebViewScreenshot.shtml) for Windows to better use right DPI for high DPI screens.
- **Version 11.4**
    - Added [Container.Screenshot](https://www.mbsplugins.eu/ContainerScreenshot.shtml) function, which may replace [WebView.Screenshot](https://www.mbsplugins.eu/WebViewScreenshot.shtml) for some users.
- **Version 9.0**
    - Changed [WebView.Screenshot](http://www.mbsplugins.eu/WebViewScreenshot.shtml), [Window.Screenshot](http://www.mbsplugins.eu/WindowScreenshot.shtml) and [Screenshot](http://www.mbsplugins.eu/component_Screenshot.shtml) function to mark image with resolution for Windows.
- **Version 8.5**
    - Added [WebView.Screenshot](http://www.mbsplugins.eu/WebViewScreenshot.shtml) and [Window.Screenshot](http://www.mbsplugins.eu/WindowScreenshot.shtml) for iOS.
- **Version 7.2**
    - Fixed coordinates for [WebView.Screenshot](http://www.mbsplugins.eu/WebViewScreenshot.shtml) with multiple screens.

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#6ScriptAnchor_)
- [WebViewer/MethodDraw SVG Editor/MethodDraw](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/MethodDraw%20SVG%20Editor/MethodDraw.shtml#7ScriptAnchor_)
- [WebViewer/WebViewer Render PDF (Mac)](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Render%20PDF%20%28Mac%29.shtml#6ScriptAnchor_)
- [WebViewer/WebViewer Save PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Save%20PDF.shtml#7ScriptAnchor_)
- [WebViewer/WebViewer Screenshot](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Screenshot.shtml#1GroupButton30.00000005.000000049.0000000160.0000000LayoutObjectAnchor_)

### Blog Entries

- [Printing a WebViewer in FileMaker](https://www.mbsplugins.de/archive/2024-02-16/Printing_a_WebViewer_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [Control interactive containers in FileMaker](https://www.mbsplugins.de/archive/2023-12-19/Control_interactive_containers/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.1pr6](https://www.mbsplugins.de/archive/2023-03-03/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.4pr1](https://www.mbsplugins.de/archive/2021-08-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.6pr5](https://www.mbsplugins.de/archive/2018-12-23/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 8.5 - More than 5500 Functions In One Plugin](https://www.mbsplugins.de/archive/2018-11-27/MBS_FileMaker_Plugin_85_-_More/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr5](https://www.mbsplugins.de/archive/2018-11-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.2pr4](https://www.mbsplugins.de/archive/2017-04-26/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.3pr5](https://www.mbsplugins.de/archive/2015-09-28/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.2pr4](https://www.mbsplugins.de/archive/2015-06-24/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 4th November 2021

  
[WebView.RunJavaScriptReturnTitle](WebViewRunJavaScriptReturnTitle.md) - [WebView.Scrollbar.getHorizontalMaximum](WebViewScrollbargetHorizontalMaximum.md)

[HTML Version](WebViewScreenshot.shtml)