Aspose.OMR Create Template from markup text in VB.net

Dear Sir

I am Churchill. I am trying aspose.omr for multiple choice marking at school exam. We are using vb.net to generate omr template from markup text. Please help to provide vb.net code to geneate template *.omr?

Thank you

Regards

Churchil

@churchilllee

You can please use following code snippet in order to generate an OMR Template using the API:

Private Sub SurroundingSub()
    Dim engine As OmrEngine = New OmrEngine()
    Dim res As GenerationResult = engine.GenerateTemplate(Path.Combine(testFolderPath, "Grid.txt"))

    If res.ErrorCode <> 0 Then
        Console.WriteLine("ERROR CODE: " & res.ErrorCode)
    End If

    res.Save(outputPath, "Grid")
End Sub

For further information and examples please check following documentation section. You can use any code converter to convert C# code into VB:

Dear Sir

Thank you for your quick reply. I have tried but doesn’t work. I am using Visual Studio 2015 and the project is ASP.net webform code behind.

Here is my code:

Imports Aspose.OMR
Imports Aspose.OMR.Generation

I got an error from
“Dim engine As OmrEngine = New OmrEngine()”
Error Message:
Initializes a new instance of the OmrEngine class
Overload resolution failed because no accessible ‘New’ accepts this number of arguments
It needs parameter in ‘New’ engine.

And
Dim res As GenerationResult = engine.GenerateTemplate(Path.Combine(testFolderPath, “Grid.txt”))
Error Message:
GenerateTemplate is not a member of ‘OmrEngine’

Thanks again for your support.

Regards

Churchill

@churchilllee

Would you please try to make a .zip of your project after removing the DLLs and share with us. We will test it at our side and share our feedback with you accordingly.

Dear Sir

Thanks for your support. I found the solution. The problem can be fixed by add
Imports Aspose.OMR.Api
Imports Aspose.OMR.Generation

I can generate a template now.

Thank you

Churchill

@churchilllee

It is nice to hear that you were able to sort the issue out. Please let us know in case you need further assistance.