//*******************************************************************************************//
//                                                                                           //
// Download Free Evaluation Version From: https://bytescout.com/download/web-installer       //
//                                                                                           //
// Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup               //
//                                                                                           //
// Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                //
// https://www.bytescout.com                                                                 //
// https://pdf.co                                                                            //
//                                                                                           //
//*******************************************************************************************//


using System.Diagnostics;
using System.IO;
using Bytescout.Spreadsheet;

namespace ExportToJSON
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Spreadsheet spreadsheet = new Spreadsheet())
            {
            	// Load document
                spreadsheet.LoadFromFile("Table.xls");
                
                // Export first worksheet to JSON format
                string jsonString = spreadsheet.ExportToJSON(0);
                
                // Write JSON string to file
                File.WriteAllText("exported.json.txt", jsonString);

				// Open the result file in default associated application
                Process.Start("exported.json.txt");
            }
        }
    }
}
