Window.AsPDF
------------

Renders the window as PDF so you can save it in a container value. Includes a JPEG preview.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Window](component_Window.md) | [2.3](newinversion23.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "Window.AsPDF"; WindowRef { ; FileName; DontRenderPreview } ) 

**MBS**( **"Window.AsPDF";** /\* Renders the window as PDF so you can save it in a container value. Includes a JPEG preview. \*/  
**$WindowRef**; /\* Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window.e.g. 0 \*/   
**$FileName**; /\* Optional; The filename for the PDF file. Default is "window.pdf".e.g. "mywindow.pdf" \*/   
**$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 |
|---|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window. | 0 |  |
| FileName | The filename for the PDF file. Default is "window.pdf". | "mywindow.pdf" | Optional |
| DontRenderPreview | Pass 1 to not create a JPEG with preview of first page as part of the container. | 0 | Optional |

### Description

Renders the window as PDF so you can save it in a container value. Includes a JPEG preview.  
### Examples

Queries PDF of current window:

 MBS ( "Window.AsPDF")  
### See also

- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)

### Example Databases

- [Window/PDF from Window (Mac)](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/PDF%20from%20Window%20%28Mac%29.shtml#1ScriptAnchor_)

### Blog Entries

- [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 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.4pr3](https://www.mbsplugins.de/archive/2011-05-14/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.3pr4](https://www.mbsplugins.de/archive/2011-02-18/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 9th March 2015

  
[Window.AddToTaskbar](WindowAddToTaskbar.md) - [Window.ClearCloseTrigger](WindowClearCloseTrigger.md)

[HTML Version](WindowAsPDF.shtml)