These sample source codes on this page below are displaying how to convert xfa form to xml in pdf with pdf extractor sdk in VB.NET. What is ByteScout Data Extraction Suite? It is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can help you to convert xfa form to xml in pdf with pdf extractor sdk in your VB.NET application.
These VB.NET code samples for VB.NET guide developers to speed up coding of the application when using ByteScout Data Extraction Suite. Simply copy and paste in your VB.NET project or application you and then run your app! Check VB.NET sample code samples to see if they respond to your needs and requirements for the project.
You can download free trial version of ByteScout Data Extraction Suite from our website with this and other source code samples for VB.NET.
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