DynaPDF.DeleteTemplate
----------------------

Deletes a template.

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

MBS( "DynaPDF.DeleteTemplate"; PDF; Handle ) 

**MBS**( **"DynaPDF.DeleteTemplate";** /\* Deletes a template. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Handle**) /\* Template handle.e.g. $template \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Handle | Template handle. | $template |

### Result

Returns OK or error.

### Description

Deletes a template.   
The parameter Handle must be a valid template handle. A template is not physically deleted by this function, only the content stream is cleared. Templates can be references in other content stream so that it is quite complex to delete a template physically at runtime. However, this behavior is maybe changed in a future version of DynaPDF.   
Imported PDF pages are converted to templates by default. The handles of such templates are often not known, however, it is possibly to delete them by using the function [DynaPDF.DeleteTemplateEx](DynaPDFDeleteTemplateEx.md).  
See also [DeleteTemplate](https://www.monkeybreadsoftware.com/DynaPDF-Manual/DeleteTemplate.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.BeginTemplate](DynaPDFBeginTemplate.md)
- [DynaPDF.DeleteTemplateEx](DynaPDFDeleteTemplateEx.md)
- [DynaPDF.EditTemplate](DynaPDFEditTemplate.md)
- [DynaPDF.EditTemplate2](DynaPDFEditTemplate2.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.PlaceTemplate](DynaPDFPlaceTemplate.md)
- [DynaPDF.PlaceTemplateEx](DynaPDFPlaceTemplateEx.md)
- [DynaPDF.RotateTemplate](DynaPDFRotateTemplate.md)

This function checks for a license.

Created 6th February 2015 , last changed 3th January 2021

  
[DynaPDF.DeleteSeparationInfo](DynaPDFDeleteSeparationInfo.md) - [DynaPDF.DeleteTemplateEx](DynaPDFDeleteTemplateEx.md)

[HTML Version](DynaPDFDeleteTemplate.shtml)