Link Search Menu Expand Document

Read Hindi Text - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Read Hindi Text’

Program.vb
Imports System.Text
Imports Bytescout.PDFExtractor

Module Program

    Sub Main()

        Try

            ' Files
            Dim fileName As String = "hindiText.pdf"
            Dim destFileName As String = "extractedText.txt"

            ' Read all text from pdf file
            Dim extractor As TextExtractor = New TextExtractor

            ' Load PDF document
            extractor.LoadDocumentFromFile(fileName)

            ' Option 1: Extract all text and write to destination file
            extractor.SaveTextToFile(destFileName, encoding := Encoding.Unicode)

            Console.WriteLine("All extracted text (hindi) written successfully to destination text file.")

            Process.Start(destFileName)

            ' Option 2: Read all text to string variable
            'Dim allText As String = extractor.GetText

            ' Cleanup
            extractor.Dispose()

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try

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

    End Sub

End Module

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK