Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to extract text from Hebrew pdf. I'm running this code:

    Dim in_str_PDF_FileName As String = "C:UsersliorhDesktopReadPDF1.pdf"
    Dim oReader2 As New iText.Kernel.Pdf.PdfReader(in_str_PDF_FileName)
    Dim doc As New iText.Kernel.Pdf.PdfDocument(oReader2)


    Dim sOut2 As String
    Dim page As iText.Kernel.Pdf.PdfPage



    sOut2 = ""

    Dim i As Integer

    
    Dim its2 As New iText.Kernel.Pdf.Canvas.Parser.Listener.LocationTextExtractionStrategy

    For i = 1 To doc.GetNumberOfPages

        page = doc.GetPage(i)

        sOut2 += iText.Kernel.Pdf.Canvas.Parser.PdfTextExtractor.GetTextFromPage(page, its2.SetRightToLeftRunDirection(True))

    Next

    MsgBox(sOut2)

I get the Hebrew in reversed text (LTR instead of RTL). The numbers are OK so I don't want to try and manipulating the whole text. What am I doing wrong?

question from:https://stackoverflow.com/questions/65937582/extract-hebrew-text-from-pdf-by-itext-7

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
542 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...