ByteScout PDF Extractor SDK - C# - PDF XFA Form To XML - ByteScout

ByteScout PDF Extractor SDK – C# – PDF XFA Form To XML

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – PDF XFA Form To XML

PDF XFA form to XML in C# using ByteScout PDF Extractor SDK

Tutorial: how to do PDF XFA form to XML in C#

Every ByteScout tool contains example C# source codes that you can find here or in the folder with installed ByteScout product. ByteScout PDF Extractor SDK was made to help with PDF XFA form to XML in C#. ByteScout PDF Extractor SDK is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker.

You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. Follow the instruction from the scratch to work and copy and paste code for C# into your editor. Code testing will allow the function to be tested and work properly with your data.

ByteScout PDF Extractor SDK free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.

Try ByteScout PDF Extractor SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

using System; using Bytescout.PDFExtractor; namespace XFAFormToXML { class Program { static void Main(string[] args) { // Create Bytescout.PDFExtractor.XFAFormExtractor instance XFAFormExtractor extractor = 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 foreach (XFAFormContentType contentType in Enum.GetValues(typeof(XFAFormContentType))) { // Get count of content parts of specified type int partCount = extractor.GetCount(contentType); // Save parts as XML files for (int i = 0; i < partCount; i++) { string fileName = contentType.ToString() + i + ".xml"; extractor.SaveToFile(contentType, i, fileName); Console.WriteLine("Saved form part " + fileName); } } // Cleanup extractor.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadLine(); } } }

Try ByteScout PDF Extractor SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)



Get 60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Get ByteScout PDF Extractor SDK Free Training


Get Your Free API Key

Explore Web API Documentation