When I am searching "Android" text in whole PDF I am not able to add annotations correctly.
It only search first "Android" text on every page of the whole pdf.
I want to addURI to all Android Word in the PDF,
So please give example to seach all "Android" words in PDF and get cordinates of every particular "Android" text.
I used below code for achiving but I am not getting currect result
public void AddAnnonateURI() {
String str = "Android";
int pagesCount = m_doc.GetPageCount();
for (int i = 0; i < pagesCount; i++) {
Page currentPage = m_doc.GetPage(i);
currentPage.ObjsStart();
// Finder mFinder = new Finder();
Finder mFinder = currentPage.FindOpen(str, true, true);
if (mFinder != null) {
int finds = mFinder.GetCount();
int ichar = mFinder.GetFirstChar(0);
int ichar_end = ichar + str.trim().length() - 1;
float rect[] = new float[4];
float rect_end[] = new float[4];
currentPage.ObjsGetCharRect(ichar, rect);
currentPage.ObjsGetCharRect(ichar_end, rect_end);
// currentPage.AddAnnotMarkup(ichar, ichar_end, 0);
currentPage.AddAnnotURI(new float[] { rect[0], rect[1],
rect_end[2], rect_end[3] }, str);
for (int j = 0; j < finds; j++) {
// System.err.println("page" + (i + 1));
// int foundIndex = mFinder.GetFirstChar(j);
}
mFinder.Close();
}
currentPage.Close();
}
// m_reader.PDFSave();
}