Link Search Menu Expand Document

Convert PDF To CSV (Merge multiline text to table cell) - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Convert PDF To CSV (Merge multiline text to table cell)’

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Bytescout.PDFExtractor
Imports System.Diagnostics

Namespace ConsoleApplication1

    Class Program

        Shared Sub Main(ByVal args As String())

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

            ' Load sample PDF document

            ' You can change CSV separator symbol (if needed) from "," symbol to another if needed for non-US locales
            'extractor.CSVSeparatorSymbol = "," 

            ' For multiline cell join extracted cell text into single line
            extractor.LineGroupingMode = LineGroupingMode.GroupByRows
            extractor.Unwrap = True

            ' Save extracted CSV data to file

            ' Cleanup

            Console.WriteLine("Data has been extracted to 'output.csv' file.")
            Console.WriteLine("Press any key to continue and open CSV in default CSV viewer (or Excel)...")

            ' Open result file in default associated application (for demo purposes)
            Dim processStartInfo As New ProcessStartInfo("output.csv")
            processStartInfo.UseShellExecute = True

        End Sub
    End Class
End Namespace

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK