ByteScout PDF Extractor SDK - VB.NET - XFA Form To XML - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – VB.NET – XFA Form To XML

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – VB.NET – XFA Form To XML

ByteScout PDF Extractor SDK – VB.NET – XFA Form To XML

Program.vb

Imports Bytescout.PDFExtractor

Class Program

    Friend Shared Sub Main(args As String())

        ' Create Bytescout.PDFExtractor.XFAFormExtractor instance
        Dim extractor As New XFAFormExtractor()
        extractor.RegistrationName = "demo"
        extractor.RegistrationKey = "demo"

        ' Load PDF document
        ' (!) We do not provide the sample document, please load your own.
        extractor.LoadDocumentFromFile("samplexfa.pdf")

        ' Enumerate XFA form content part types
        For Each contentType As XFAFormContentType In [Enum].GetValues(GetType(XFAFormContentType))

            'Get count of content parts of specified type
            Dim partCount As Integer = extractor.GetCount(contentType)

            ' Save parts as XML files
            For i As Integer = 0 To partCount - 1
                Dim fileName As String = contentType.ToString() + i.ToString() + ".xml"
                extractor.SaveToFile(contentType, i, fileName)
                Console.WriteLine("Saved form part " + fileName)
            Next

        Next

        ' Cleanup
        extractor.Dispose()

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

    End Sub

End Class


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next