WebView.RenderPDF
-----------------

Renders the web view to a PDF.

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

MBS( "WebView.RenderPDF"; WebViewerRef { ; FileName; DontRenderPreview } ) 

**MBS**( **"WebView.RenderPDF";** /\* Renders the web view to a PDF. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$FileName**; /\* Optional; The filename to use for the picture. Default is "image" with the extension matching the image type.e.g. "test.jpg" \*/   
**$DontRenderPreview**) /\* Optional; Pass 1 to not create a JPEG with preview of first page as part of the container.e.g. 0 \*/ 

### 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. |  |  |
| FileName | The filename to use for the picture. Default is "image" with the extension matching the image type. | "test.jpg" | Optional |
| DontRenderPreview | Pass 1 to not create a JPEG with preview of first page as part of the container. | 0 | Optional |

### Result

Returns a container with a PDF of the webpage (and a JPEG preview). You can store it in a media field.

### Description

Renders the web view to a PDF.  
  
For OS X please use [WebView.SetPreferences](WebViewSetPreferences.md) to set whether to include background images.  
If you need a multi page PDF file, please use [WebView.PrintToFile](WebViewPrintToFile.md) function.  
  
Implemented for WebKit 2 in MBS Plugin 10.5 for macOS with Safari 14.  
### Examples

Render PDF:

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

- [WebView.FindByName](WebViewFindByName.md)
- [WebView.Print](WebViewPrint.md)
- [WebView.PrintToFile](WebViewPrintToFile.md)
- [WebView.RenderImage](WebViewRenderImage.md)
- [WebView.Screenshot](WebViewScreenshot.md)
- [WebView.SetPreferences](WebViewSetPreferences.md)

### Release notes

- **Version 10.5**
    - Implemented [WebView.RenderPDF](https://www.mbsplugins.eu/WebViewRenderPDF.shtml) for WebKit 2 for macOS with Safari 14 or newer.

### Example Databases

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

### 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 10.5pr9](https://www.mbsplugins.de/archive/2020-11-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr1](https://www.mbsplugins.de/archive/2015-03-16/MBS_FileMaker_Plugin_version_5/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)

### 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 10th November 2020

  
[WebView.RenderImage](WebViewRenderImage.md) - [WebView.ResetPageZoom](WebViewResetPageZoom.md)

[HTML Version](WebViewRenderPDF.shtml)