Link Search Menu Expand Document

PDF To XML - C#

PDF Extractor SDK sample in C# demonstrating ‘PDF To XML’

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

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

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

            extractor.SaveXMLToFile("output.XML");

            // Cleanup
			extractor.Dispose();

            Console.WriteLine();
            Console.WriteLine("Data has been extracted to 'output.XML' file.");
            Console.WriteLine();
            Console.WriteLine("Press any key...");
            Console.ReadKey();
        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK