VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.FormsProcessing.FormRecognition Namespace / FormFieldTemplate Class
Members Example



In This Topic
    FormFieldTemplate Class
    In This Topic
    Provides the abstract base class that contains information about form field template.
    Object Model
    FormFieldTemplate Class
    Syntax
    'Declaration
     
    Public MustInherit Class FormFieldTemplate 
    public abstract class FormFieldTemplate 
    public __gc abstract class FormFieldTemplate 
    public ref class FormFieldTemplate abstract 
    Example
    This example 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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also