Link Search Menu Expand Document

Detect Lines in PDF - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Detect Lines in PDF’

Imports Bytescout.PDFExtractor

' Detect all lines in PDF documents

Module Program

    Sub Main()


            Using lineDetector As New LineDetector("demo", "demo")

                ' Load PDF Document

                ' Get all lines
                Dim foundLinesCollection As FoundLinesCollection = lineDetector.FindLines(0, LineOrientationsToFind.HorizontalAndVertical)

                ' Print output
                Console.WriteLine("Total {0} lines Detected", foundLinesCollection.Count)

                For Each foundLine As FoundLine In foundLinesCollection
                    Console.WriteLine("From: {0}, To: {1}, Width: {2}, Line Orientation: {3}",
                            foundLine.From.ToString(), foundLine.To.ToString(), foundLine.Width, foundLine.LineOrientation.ToString())

            End Using

        Catch ex As Exception
            Console.WriteLine("ERROR:" + ex.Message)
        End Try

        Console.WriteLine("Press any key to exit...")
    End Sub

End Module

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK