The sample source codes below show how to convert from PDF to XLS file for MS Excel in C# and Visual Basic .NET using Bytescout PDF Extractor SDK.
C#
using System.IO; using Bytescout.PDFExtractor; using System.Diagnostics; <span data-scayt_word="namespace" data-scaytid="3">namespace</span> <span data-scayt_word="PDF2CSV2XLS" data-scaytid="4">PDF2CSV2XLS</span> { class Program { static void Main(string[] <span data-scayt_word="args" data-scaytid="5">args</span>) { // Create Bytescout.PDFExtractor.XLSExtractor instance <span data-scayt_word="CSVExtractor" data-scaytid="6">CSVExtractor</span> extractor = new <span data-scayt_word="XLSExtractor" data-scaytid="7">XLSExtractor</span>(); extractor.RegistrationName = "demo"; extractor.RegistrationKey = "demo"; File.Delete("output.xls"); // Load sample PDF document extractor.LoadDocumentFromFile("sample3.pdf"); // Save the spreadsheet to file extractor.SaveAsXLSFile("output.xls"); // Open the spreadsheet in default associated application Process.Start("output.xls"); } } }
VB.NET
Imports System.IO Imports Bytescout.PDFExtractor Imports System.Diagnostics Class Program Friend Shared Sub Main(<span data-scayt_word="args" data-scaytid="18">args</span> As String()) ' Create Bytescout.PDFExtractor.XLSExtractor instance Dim extractor As New <span data-scayt_word="XLSExtractor" data-scaytid="19">XLSExtractor</span>() extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" File.Delete("output.xls") ' Load sample PDF document extractor.LoadDocumentFromFile("sample3.pdf") ' Save the spreadsheet to file extarctor.SaveAsXLSFile("output.xls") ' Open the spreadsheet in default associated application Process.Start("output.xls") End Sub End Class