DynaPDF.EditTemplate
--------------------

Prepares a template for editing.

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

MBS( "DynaPDF.EditTemplate"; PDF; TemplateIndex ) 

**MBS**( **"DynaPDF.EditTemplate";** /\* Prepares a template for editing. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$TemplateIndex**) /\* Index of template. From 0 to DynaPDF.GetTemplateCount-1.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| TemplateIndex | Index of template. From 0 to DynaPDF.GetTemplateCount-1. | 0 |

### Result

Returns OK or error.

### Description

Prepares a template for editing.   
The parameter Index is the array index inside the page that contains the template. To get the number of templates used by a page call the function [DynaPDF.GetTemplCount](DynaPDFGetTemplCount.md). The current graphics state is saved entirely before the template will be opened. This graphics state is restored when the template is closed with [DynaPDF.EndTemplate](DynaPDFEndTemplate.md). That means, the current font, line width, fill color and so on are all restored to its values before entering the template. [DynaPDF.EndTemplate](DynaPDFEndTemplate.md) requires an open page that must be opened with [DynaPDF.EditPage](DynaPDFEditPage.md) beforehand. After the changes are made the template must be closed with [DynaPDF.EndTemplate](DynaPDFEndTemplate.md).   
  
DynaPDF.EditTemplate is mostly used to extract text strings from imported PDF files because imported pages are converted to templates by default. See DynaPDF.GetPagetext() for an example application.   
See also [EditTemplate](https://www.monkeybreadsoftware.com/DynaPDF-Manual/EditTemplate.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.BeginTemplate](DynaPDFBeginTemplate.md)
- [DynaPDF.DeleteTemplate](DynaPDFDeleteTemplate.md)
- [DynaPDF.DeleteTemplateEx](DynaPDFDeleteTemplateEx.md)
- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.EditTemplate2](DynaPDFEditTemplate2.md)
- [DynaPDF.EndTemplate](DynaPDFEndTemplate.md)
- [DynaPDF.GetContent](DynaPDFGetContent.md)
- [DynaPDF.GetTemplCount](DynaPDFGetTemplCount.md)
- [DynaPDF.PlaceTemplate](DynaPDFPlaceTemplate.md)
- [DynaPDF.RotateTemplate](DynaPDFRotateTemplate.md)

### Blog Entries

- [MBS FileMaker Plugin 5.1 for OS X/Windows](https://www.mbsplugins.de/archive/2015-05-19/MBS_FileMaker_Plugin_51_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr9](https://www.mbsplugins.de/archive/2015-05-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 16th May 2015 , last changed 17th May 2015

  
[DynaPDF.EditPage](DynaPDFEditPage.md) - [DynaPDF.EditTemplate2](DynaPDFEditTemplate2.md)

[HTML Version](DynaPDFEditTemplate.shtml)