Link Search Menu Expand Document

Extract Table Structure from PDF - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Extract Table Structure from PDF’

Program.vb
Imports Bytescout.PDFExtractor

Class Program
	Friend Shared Sub Main(args As String())

        ' Create Bytescout.PDFExtractor.StructuredExtractor instance
        Dim extractor As New StructuredExtractor()
		extractor.RegistrationName = "demo"
		extractor.RegistrationKey = "demo"

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


        For pageIndex As Integer = 0 To extractor.GetPageCount() - 1

            Console.WriteLine("Starting extraction from page #" + pageIndex.ToString())
            Console.WriteLine()

            extractor.PrepareStructure(pageIndex)

            Dim rowCount As Integer = extractor.GetRowCount(pageIndex)

            For row As Integer = 0 To rowCount - 1

                Dim columnCount As Integer = extractor.GetColumnCount(pageIndex, row)

                For col As Integer = 0 To columnCount - 1

                    Console.WriteLine(extractor.GetCellValue(pageIndex, row, col))

                Next
            Next
        Next

        ' Cleanup
		extractor.Dispose()

        Console.WriteLine()
        Console.WriteLine("Press any key to continue...")
        Console.ReadLine()

	End Sub
End Class

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK