I am trying read the content of hindi PDF. I have used itext7 library to read the PDF file.
It's working fine for English language PDFs and getting the exact characters also But When I try with any Hindi(local) language PDF, values are in unreadable format.
Uncreadable Format in which I am getting the text
d d d daaaah h eeh h ee aaaa
Here is sample code of reading PDF page wise.
val pdfReader = PdfReader("pdfPath")
PdfDocument(pdfReader).use { doc ->
pdfContent = PdfTextExtractor.getTextFromPage(doc.getPage(1))
}
pdfReader.close()
Do I need to pass and language parameter to itext7 library to get the exact contents ?