Hi,
I am trying to read the text from the region by giving the coordinates. but its not able to read the right text from that region. It returns the wrong text.
Any help would be appreciated.
My Code:
const txt = await PDFNet.TextExtractor.create();
const rect = await PDFNet.Rect.init(99.98378847999993, 1555.54, 180, 1574.7627664);
await txt.begin(firstPage , rect); // Read the page.
//Extract words one by one.
let line = await txt.getFirstLine();
for (; (await line.isValid()); line = (await line.getNextLine()))
{
for (let word = await line.getFirstWord(); (await word.isValid()); word = (await word.getNextWord()))
{
const text = await word.getString();
console.log(text);
}
}