Link Search Menu Expand Document

Convert XFA Form To XML in PDF - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Convert XFA Form To XML in PDF’

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.

        ' 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)


        ' Cleanup

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

    End Sub

End Class

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK

Copyright © 2016 - 2021 ByteScout