VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.FormsProcessing.FormRecognition Namespace / FormTemplateManager Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
FormTemplateManager Class
In This Topic
Provides the synchronized link between images of pages templates and pages templates.
Object Model
ImageCollection FormTemplateManager
Syntax
'Declaration

Public Class FormTemplateManager

public class FormTemplateManager

Example

This C#/VB.NET code shows how to load a document template from a file, get number of template images, add new page template, remove the first page template and save the document template with new name.


''' <summary>
''' Opens a document template, writes count of template images, adds new page template,
''' removes first page template and saves document template with new name.
''' </summary>
Public Shared Sub FormTemplateManagerExample()
    ' create a form template manager
    Dim templateManager As New Vintasoft.Imaging.FormsProcessing.FormRecognition.FormTemplateManager()
    ' load templates from a document
    templateManager.LoadFromDocument("C:\templateDocument.fdt")
    ' write template images count
    System.Console.WriteLine(String.Format("Count of template images: {0}", templateManager.TemplateImages.Count))

    ' create new page template
    Dim pageTemplate As New Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate()
    ' set the name of the page template
    pageTemplate.Name = "Added page template"
    ' add new page template linked with template image
    templateManager.AddPageTemplate(New Vintasoft.Imaging.VintasoftImage("C:\formTemplate.tif"), pageTemplate)

    ' remove first page template
    templateManager.TemplateImages.RemoveAt(0)
    ' change name of the document
    templateManager.DocumentName = String.Format("{0} - revised", templateManager.DocumentName)
    ' save as a document template
    templateManager.SaveToDocument("C:\templateDocument_revised.fdt")
End Sub


/// <summary>
/// Opens a document template, writes count of template images, adds new page template,
/// removes first page template and saves document template with new name.
/// </summary>
public static void FormTemplateManagerExample()
{
    // create a form template manager
    Vintasoft.Imaging.FormsProcessing.FormRecognition.FormTemplateManager templateManager = 
        new Vintasoft.Imaging.FormsProcessing.FormRecognition.FormTemplateManager();
    // load templates from a document
    templateManager.LoadFromDocument(@"C:\templateDocument.fdt");
    // write template images count
    System.Console.WriteLine(string.Format("Count of template images: {0}", templateManager.TemplateImages.Count));

    // create new page template
    Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate pageTemplate = 
        new Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate();
    // set the name of the page template
    pageTemplate.Name = "Added page template";
    // add new page template linked with template image
    templateManager.AddPageTemplate(
        new Vintasoft.Imaging.VintasoftImage(@"C:\formTemplate.tif"), pageTemplate);

    // remove first page template
    templateManager.TemplateImages.RemoveAt(0);
    // change name of the document
    templateManager.DocumentName = string.Format("{0} - revised", templateManager.DocumentName);
    // save as a document template
    templateManager.SaveToDocument(@"C:\templateDocument_revised.fdt");
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.FormsProcessing.FormRecognition.FormTemplateManager

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also