WinPDF.Release
--------------

Releases an object reference.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WinPDF](component_WinPDF.md) | [13.2](newinversion132.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "WinPDF.Release"; PDFRef ) 

**MBS**( **"WinPDF.Release";** /\* Releases an object reference. \*/  
**$PDFRef**) /\* The reference number for the PDF document.e.g. $PDF \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDFRef | The reference number for the PDF document. | $PDF |

### Result

Returns OK or error.

### Description

Releases an object reference.  
Please call that for all PDF objects to release memory.  
### Examples

Query page count from a PDF:

 Set Variable \[ $pdf ; Value:MBS ( "[WinPDF.LoadContainer](WinPDFLoadContainer.md)"; WinPDF::InputPDF ; WinPDF::Password ) \]  
If \[ MBS ("IsError") \]  
 Show Custom Dialog \[ Title: "Failed to open PDF."; Message: $pdf ; Default Button: “OK”, Commit: “Yes” \]  
 Exit Script \[ \]  
End If  
\# query page count   
Set Variable \[ $count ; Value:MBS ( "[WinPDF.PageCount](WinPDFPageCount.md)"; $pdf ) \]  
Set Field \[ WinPDF::PageCount ; $count \]  
\# cleanup   
Set Variable \[ $r ; Value:MBS ( "WinPDF.Release"; $pdf ) \]  
### See also

- [DynaPDF.Release](DynaPDFRelease.md)
- [IsError](IsError.md)
- [PDFKit.GetPDFPageImage](PDFKitGetPDFPageImage.md)
- [WinPDF.LoadContainer](WinPDFLoadContainer.md)
- [WinPDF.PageCount](WinPDFPageCount.md)
- [WinPDF.PageImage](WinPDFPageImage.md)
- [WinPDF.PageImageAtSize](WinPDFPageImageAtSize.md)
- [WinPDF.ReleaseAll](WinPDFReleaseAll.md)

### Example Databases

- [Containers/Create Container Preview](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Containers/Create%20Container%20Preview.shtml#1ScriptAnchor_)
- [Win Only/WinPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/WinPDF.shtml#2ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [Windows PDF Functions](https://www.mbsplugins.de/archive/2023-04-11/Windows_PDF_Functions/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 8th March 2023 , last changed 27th August 2023

  
[WinPDF.PageWidth](WinPDFPageWidth.md) - [WinPDF.ReleaseAll](WinPDFReleaseAll.md)

[HTML Version](WinPDFRelease.shtml)