ByteScout Document Parser SDK - VB.NET - General Example - ByteScout

ByteScout Document Parser SDK – VB.NET – General Example

  • Home
  • /
  • Articles
  • /
  • ByteScout Document Parser SDK – VB.NET – General Example

ByteScout Document Parser SDK – VB.NET – General Example

Module1.vb

Imports ByteScout.DocumentParser

' This example demonstrates document data parsing to JSON and YAML formats.

Module Module1

    Sub Main()

        Dim templatesFolder As String = ".\Templates"
        Dim inputDocument1 As String = ".\DigitalOcean.pdf"
        Dim inputDocument2 As String = ".\AmazonAWS.pdf"

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

            Console.WriteLine("Loading templates...")
                
            Dim count = documentParser.AddTemplates(templatesFolder)

            Console.WriteLine($"{count} templates loaded.")
            Console.WriteLine()


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

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

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

            ' Parse document data in YAML format
            Dim yamlString As String = documentParser.ParseDocument(inputDocument2, OutputFormat.YAML)
            ' Display parsed data in console
            Console.WriteLine("Parsing results in YAML format:")
            Console.WriteLine()
            Console.WriteLine(yamlString)

        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

prev
next