Hi,
I am trying to read the text inside a rectangle from a pdf document. ratio of working to not working is 25% : 75%
I have used the following code, but Its not working for most of the documents. The code is as below :
private static String getHyperlinkText(Page currentPage, LinkAnnotation hyplnkAction) {
TextAbsorber absorber = new TextAbsorber();
Rectangle rectangle = hyplnkAction.getRect();
TextSearchOptions options = new TextSearchOptions(rectangle);
options.setLimitToPageBounds(true);
absorber.setTextSearchOptions(options);
currentPage.accept(absorber);
// get the text associated with hyperlink
return absorber.getText();
}