ByteScout Document Parser SDK - VB.NET - Custom Template - ByteScout

ByteScout Document Parser SDK – VB.NET – Custom Template

  • Home
  • /
  • Articles
  • /
  • ByteScout Document Parser SDK – VB.NET – Custom Template

ByteScout Document Parser SDK – VB.NET – Custom Template

Module1.vb

Imports ByteScout.DocumentParser

' This example demonstrates data parsing from an invoice using the custom template.

Module Module1

    Sub Main()

        Dim customTemplate As String = ".\SampleTemplate.yml"
        Dim inputDocument As String = ".\SampleInvoice.pdf"

        ' Create DocumentParser instance
        Using documentParser As New DocumentParser("demo", "demo")

            Console.WriteLine($"Loading template ""{customTemplate}""...")
            Console.WriteLine()

            documentParser.AddTemplate(customTemplate)

            Console.WriteLine($"Parsing ""{inputDocument}""...")
            Console.WriteLine()

            ' Parse invoice data in JSON format
            Dim jsonString As String = documentParser.ParseDocument(inputDocument, OutputFormat.JSON)
            ' Display parsed data in console
            Console.WriteLine("Parsing results in JSON format:")
            Console.WriteLine()
            Console.WriteLine(jsonString)
            
        End Using

        Console.WriteLine()
        Console.WriteLine("Press any key to continue...")
        Console.ReadLine()

    End Sub

End Module


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next