<font class="Apple-style-span" size="4">Hi, everyone on Poppler.<br><br>I am all new to Poppler.<br>These days I am trying to implement findText function using Objective C on the Mac.<br><br>But I failed to implement it.<br>
<br>My Code is as follows :<br><br><br><br><br>//-----------start of code --------------------------------------------------//<br>const char *arg_search = "turorial" ;<br><br>ustring text = ustring::from_utf8(arg_search, -1) ;<br>
const size_t len = text.length();<br>std::vector<Unicode> u(len);<br>for (size_t i = 0; i < len; ++i) {<br> u[i] = text[i];<br>}<br><br><br><br>......................<br>......................<br><br><br><br>int firstPage = 9 ;<br>
<br>double sLeft, sTop, sRight, sBottom ;<br>sLeft = sTop = 0.0 ;<br><br>thePage = doc->getPage(firstPage) ;<br>sRight = thePage->getMediaWidth() ;<br>sBottom = thePage->getMediaHeight() ;<br><br>textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse);<br>
doc->displayPage(textOut, firstPage, resolution, resolution, 0, gFalse, gTrue, gFalse);<br>textPage = textOut->takeText();<br><br><br><br>/*<br>textPage->getText(sLeft, sTop, sRight, sBottom) ; --------------------> (1) works OK<br>
theWordList = textPage->makeWordList(gFalse) ; --------------------> (2) works OK<br>*/<br><br>found = textPage->findText(&u[0], len, gTrue, gTrue, gFalse, gFalse, gTrue, gFalse, &sLeft, &sTop, &sRight, &sBottom) ;<br>
<br><br>textPage->decRefCnt() ;<br>//-----------end of code --------------------------------------------------//<br><br><br>the result of findText (found) is always false.<br><br>Is there any mistake or ??<br><br><br>
<br>the result of (1), and (2) is OK.<br><br>But the result of findText is always false.<br><br>Why ?<br><br>I can find the reason any more.<br><br>I guess the main problem seems to be conversion arg_search to Unicode used in <meta charset="utf-8">findText(&u[0]..........................) .<br>
</font><font class="Apple-style-span" size="4">But I can not find out the reason and I can not point out what is wrong.<br>I can not do anything more about this.<br><br><br>Please help !!!!!!!!!!<br><br></font><div><div>
</div>
</div>