WebView.RenderImage
-------------------

Renders the WebViewer to a picture.

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

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

**MBS**( **"WebView.RenderImage";** /\* Renders the WebViewer to a picture. \*/  
**$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 a container with a JPEG picture of the webpage. You can store it in a media field.

### Description

Renders the WebViewer to a picture.  
Added Windows support in version 3.0. Due the way we capture image on Windows (we ask WebViewer to print to image), some things do not show up in the image. In that case, please use [WebView.Screenshot](WebViewScreenshot.md) function.  
On Mac you can use [WebView.RenderPDF](WebViewRenderPDF.md) to get a PDF of the website.  
For macOS the image size is the size of the full website. On Windows we only capture the area of the WebViewer, so you may see scrollbars.  
  
For macOS please use [WebView.SetPreferences](WebViewSetPreferences.md) to set whether to include background images.  
  
Added support for macOS 10.13 in FileMaker 16 or newer to render webpage in v7.4.  
Works in FileMaker 15 and older in all MacOS versions.  
Works in all FileMaker Mac versions, when using a Web Viewer with WebKit 1.x created using [WebView.Create](WebViewCreate.md).  
  
Fixed for iOS for 8.2 release.  
On Windows seems not to work well in latest IE versions. so you may better use [WebView.Screenshot](WebViewScreenshot.md).  
### Examples

Render Image:

 Set Field \[ Own WebView::Container ; MBS ( "WebView.RenderImage"; $$web ; "PNG"; "webview.png") \]  
### See also

- [WebView.Create](WebViewCreate.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.RenderPDF](WebViewRenderPDF.md)
- [WebView.Screenshot](WebViewScreenshot.md)
- [WebView.SetPreferences](WebViewSetPreferences.md)

### Release notes

- **Version 8.2**
    - Fixed [WebView.RenderImage](http://www.mbsplugins.eu/WebViewRenderImage.shtml) for iOS.
- **Version 7.4**
    - Implemented [WebView.RenderImage](http://www.mbsplugins.eu/WebViewRenderImage.shtml) for FileMaker 16 on macOS 10.13.
- **Version 7.1**
    - Improved memory management for [WebView.RenderImage](http://www.mbsplugins.eu/WebViewRenderImage.shtml) function.

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#2ScriptAnchor_)
- [WebViewer/WebViewer Render PDF (Mac)](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Render%20PDF%20%28Mac%29.shtml#4ScriptAnchor_)
- [WebViewer/WebViewer Save PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Save%20PDF.shtml#6ScriptAnchor_)

### Blog Entries

- [Printing a WebViewer in FileMaker](https://www.mbsplugins.de/archive/2024-02-16/Printing_a_WebViewer_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.2pr5](https://www.mbsplugins.de/archive/2018-05-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin Schulung in 2018](https://www.mbsplugins.de/archive/2018-05-02/MBS_FileMaker_Plugin_Schulung_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.4pr7](https://www.mbsplugins.de/archive/2017-09-21/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [Custom WebView in FileMaker 16](https://www.mbsplugins.de/archive/2017-08-26/Custom_WebView_in_FileMaker_16/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.1pr4](https://www.mbsplugins.de/archive/2017-03-06/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr2](https://www.mbsplugins.de/archive/2012-10-14/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin 2.4 release notes](https://www.mbsplugins.de/archive/2011-10-11/MBS_Filemaker_Plugin_24_releas/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.4pr11](https://www.mbsplugins.de/archive/2011-09-25/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.4pr2](https://www.mbsplugins.de/archive/2011-05-12/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

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

This function checks for a license.

Created 18th August 2014 , last changed 31st October 2021

  
[WebView.RemoveScriptMessageHandler](WebViewRemoveScriptMessageHandler.md) - [WebView.RenderPDF](WebViewRenderPDF.md)

[HTML Version](WebViewRenderImage.shtml)