VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.FormsProcessing.FormRecognition Namespace / FormFieldTemplate Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
    FormFieldTemplate Class
    In This Topic
    Provides the abstract base class that contains information about form field template.
    Object Model
    FormFieldTemplate
    Syntax
    'Declaration
    
    Public MustInherit Class FormFieldTemplate
    
    
    public abstract class FormFieldTemplate
    
    
    public __gc abstract class FormFieldTemplate
    
    
    public ref class FormFieldTemplate abstract
    
    
    Example

    This C#/VB.NET code shows how to create a form template and add some form field templates to it from code.

    
    ''' <summary>
    ''' Creates a page template and adds field templates.
    ''' </summary>
    ''' <returns>
    ''' A <see cref="Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate"/> instance that contains
    ''' created form field templates.
    ''' </returns>
    Public Shared Function CreatePageTemplateAndAddFieldTemplates() As Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate
        ' create empty page template
        Dim pageTemplate As New Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate()
    
        ' create OMR field
        Dim omrFieldTemplate As Vintasoft.Imaging.FormsProcessing.FormRecognition.Omr.OmrFieldTemplate = New Vintasoft.Imaging.FormsProcessing.FormRecognition.Omr.OmrRectangularFieldTemplate()
        omrFieldTemplate.Name = "'I agree' check box"
        omrFieldTemplate.BoundingBox = New System.Drawing.RectangleF(1200, 2400, 40, 40)
        omrFieldTemplate.Threshold = 0.1F
        omrFieldTemplate.FilledValue = "YES"
        omrFieldTemplate.UnfilledValue = ""
        omrFieldTemplate.UndefinedValue = "?"
    
        ' add field template to page template
        pageTemplate.Items.Add(omrFieldTemplate)
    
        ' create OCR field
        Dim ocrFieldTemplate As New Vintasoft.Imaging.FormsProcessing.FormRecognition.Ocr.OcrFieldTemplate()
        ocrFieldTemplate.Name = "Last name"
        ocrFieldTemplate.BoundingBox = New System.Drawing.RectangleF(300, 400, 500, 200)
        ocrFieldTemplate.OcrEngineSettings = New Vintasoft.Imaging.Ocr.OcrEngineSettings(Vintasoft.Imaging.Ocr.OcrLanguage.English)
    
        ' add field template to page template
        pageTemplate.Items.Add(ocrFieldTemplate)
    
        Return pageTemplate
    End Function
    
    
    
    /// <summary>
    /// Creates a page template and adds field templates.
    /// </summary>
    /// <returns>
    /// A <see cref="Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate"/> instance that contains
    /// created form field templates.
    /// </returns>
    public static Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate CreatePageTemplateAndAddFieldTemplates()
    {
        // create empty page template
        Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate pageTemplate = 
            new Vintasoft.Imaging.FormsProcessing.FormRecognition.FormPageTemplate();
    
        // create OMR field
        Vintasoft.Imaging.FormsProcessing.FormRecognition.Omr.OmrFieldTemplate omrFieldTemplate = 
            new Vintasoft.Imaging.FormsProcessing.FormRecognition.Omr.OmrRectangularFieldTemplate();
        omrFieldTemplate.Name = "'I agree' check box";
        omrFieldTemplate.BoundingBox = new System.Drawing.RectangleF(1200, 2400, 40, 40);
        omrFieldTemplate.Threshold = 0.1f;
        omrFieldTemplate.FilledValue = "YES";
        omrFieldTemplate.UnfilledValue = "";
        omrFieldTemplate.UndefinedValue = "?";
    
        // add field template to page template
        pageTemplate.Items.Add(omrFieldTemplate);
    
        // create OCR field
        Vintasoft.Imaging.FormsProcessing.FormRecognition.Ocr.OcrFieldTemplate ocrFieldTemplate = 
            new Vintasoft.Imaging.FormsProcessing.FormRecognition.Ocr.OcrFieldTemplate();
        ocrFieldTemplate.Name = "Last name";
        ocrFieldTemplate.BoundingBox = new System.Drawing.RectangleF(300, 400, 500, 200);
        ocrFieldTemplate.OcrEngineSettings = 
            new Vintasoft.Imaging.Ocr.OcrEngineSettings(Vintasoft.Imaging.Ocr.OcrLanguage.English);
    
        // add field template to page template
        pageTemplate.Items.Add(ocrFieldTemplate);
    
        return pageTemplate;
    }
    
    

    Inheritance Hierarchy
    Requirements

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

    See Also