ByteScout PDF Extractor SDK - C# - Extract Table Structure - ByteScout

ByteScout PDF Extractor SDK – C# – Extract Table Structure

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Extract Table Structure

ByteScout PDF Extractor SDK – C# – Extract Table Structure

As a programmer, do you sometimes wish that there is a faster and easier way to complete various tasks such as seamless table structure extraction? ByteScout PDF Extractor SDK can help you in that duty. Other SDKs offer merging or splitting PDFs, automatically extracting data from PDFs, and editing and reformatting documents.

ByteScout PDF Extractor SDK gives developers of any skill and experience level the flexibility to work in different programming languages and frameworks. Moreover, it has a built-in OCR and efficient recognition technology.

Now, would you like to see ByteScout PDF Extractor SDK in action? Just copy and paste the code we provided into your C# application and witness how it makes the coding of table structure extraction so much easier and time-conserving.

You can avail of a FREE trial version by downloading it from Bytescout’s website. Programming tutorials and pertinent source code samples are also thrown in with your trial version.

Program.cs

using Bytescout.PDFExtractor;
using System.Diagnostics;
using System;

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

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

            for (int pageIndex = 0; pageIndex < extractor.GetPageCount(); pageIndex++)
            {
                Console.WriteLine("Starting extraction from page #" + pageIndex);
                Console.WriteLine();

                extractor.PrepareStructure(pageIndex);

                int rowCount = extractor.GetRowCount(pageIndex);

                for (int row = 0; row < rowCount; row++)
                {
                    int columnCount = extractor.GetColumnCount(pageIndex, row);

                    for (int col = 0; col < columnCount; col++)
                    {
                        Console.WriteLine(extractor.GetCellValue(pageIndex, row, col));
                    }
                }
            }

            // Cleanup
			extractor.Dispose();

            Console.WriteLine();
            Console.WriteLine("Press any key..");
            Console.ReadKey();
		}
	}
}


  Click here to get your Free Trial version of the SDK

Extract Table Structure – Video Guide

Tutorials:

prev
next