Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Prepares a template for editing.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.EditTemplate"; PDF; TemplateIndex )   More


Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
TemplateIndex Index of template. From 0 to DynaPDF.GetTemplateCount-1. 0


Returns OK or error.


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. 
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. That means, the current font, line width, fill color and so on are all restored to its values before entering the template. 
DynaPDF.EndTemplate requires an open page that must be opened with DynaPDF.EditPage beforehand. After the changes are made the template must be closed with DynaPDF.EndTemplate.

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 function in DynaPDF manual.

See also

Blog Entries

This function checks for a license.

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

DynaPDF.EditPage - DynaPDF.EditTemplate2