How to convert PDF to XFDF in C#, VB.NET and VBScript using PDF Extractor SDK - 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!

How to convert PDF to XFDF in C#, VB.NET and VBScript using PDF Extractor SDK

  • Home
  • /
  • Articles
  • /
  • How to convert PDF to XFDF in C#, VB.NET and VBScript using PDF Extractor SDK

These sample source codes can be used to convert PDF to XFDF (XML version of the “Forms Data Format (FDF)” specification) in C#, VB.NET, and VBScript using ByteScout PDF Extractor SDK.

Select your programming language:

How to convert PDF to XFDF in C#

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.PDFExtractor;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Bytescout.PDFExtractor.XFDFExtractor instance
            XFDFExtractor extractor = new XFDFExtractor();
            extractor.RegistrationName = "demo";
            extractor.RegistrationKey = "demo";

            // Load sample PDF document
            extractor.LoadDocumentFromFile("sample3.pdf");

            extractor.SaveXFDFToFile("output.xml");

            Console.WriteLine();
            Console.WriteLine("Data has been extracted to 'output.xml' file.");
            Console.WriteLine();
            Console.WriteLine("Press any key to continue and open file in default associated application...");
            Console.ReadKey();
            Process.Start("output.xml");
        }
    }
}

How to convert PDF to XFDF in Visual Basic .NET

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Bytescout.PDFExtractor
Imports System.Diagnostics

Namespace ConsoleApplication1
    Class Program
        Shared Sub Main(ByVal args As String())
            ' Create Bytescout.PDFExtractor.XFDFExtractor instance
            Dim extractor As New XFDFExtractor()
            extractor.RegistrationName = "demo"
            extractor.RegistrationKey = "demo"

            ' Load sample PDF document
            extractor.LoadDocumentFromFile("sample3.pdf")

            extractor.SaveXFDFToFile("output.xml")

            Console.WriteLine()
            Console.WriteLine("Data has been extracted to 'output.xml' file.")
            Console.WriteLine()
            Console.WriteLine("Press any key to continue and open file in default associated application...")
            Console.ReadKey()

            Process.Start("output.xml")
        End Sub
    End Class
End Namespace

How to convert PDF to XFDF in VBScript (Visual Basic 6)

' Create Bytescout.PDFExtractor.XFDFExtractor object
Set extractor = CreateObject("Bytescout.PDFExtractor.XFDFExtractor")

extractor.RegistrationName = "demo"
extractor.RegistrationKey = "demo"

' Load sample PDF document
extractor.LoadDocumentFromFile "../../sample3.pdf"

extractor.SaveXFDFToFile "output.xml"

MsgBox "Data has been extracted to 'output.xml' file."

Tutorials:

prev
next