DynaPDF.Clear
-------------

Starts a new PDF in memory or at the given path.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.0](newinversion30.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.Clear"; PDF { ; Path } ) 

**MBS**( **"DynaPDF.Clear";** /\* Starts a new PDF in memory or at the given path. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Path**) /\* Optional; The file path to create the PDF.e.g. "C:\\Test.pdf" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| Path | The file path to create the PDF. | "C:\\Test.pdf" | Optional |

### Result

Returns OK on success.

### Description

Starts a new PDF in memory or at the given path.  
Writing PDF to file to disk while creating it allows PDF files to be bigger than available memory. In order to have that working well, you need to call [DynaPDF.FlushPages](DynaPDFFlushPages.md) regularly to free memory.  
Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required.  
### Examples

Starts with a new blank PDF:

 $r = MBS ( "DynaPDF.clear"; $PDF )  
### See also

- [DynaPDF.FlushPages](DynaPDFFlushPages.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetUseSystemFonts](DynaPDFSetUseSystemFonts.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 14.5**
    - Added [DynaPDF.ClearLicense](https://www.mbsplugins.eu/DynaPDFClearLicense.shtml) function.

### Blog Entries

- [Extract invoice for ZUGFeRD and Facture-X](https://www.mbsplugins.de/archive/2024-09-20/Extract_invoice_for_ZUGFeRD_an/monkeybreadsoftware_blog_filemaker)

This function is free to use.

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

  
[DynaPDF.CircleAnnot](DynaPDFCircleAnnot.md) - [DynaPDF.ClearLicense](DynaPDFClearLicense.md)

[HTML Version](DynaPDFClear.shtml)