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