FindTextAsync examples?

Are there any examples of implementing the FindTextAsync in 6.1?

Hello Andrew,

Thank you for posting this question. What you should do first is call SetFindTextHandler:

http://www.pdftron.com/pdfnet/PDFNetC/da/dca/classpdftron_1_1_p_d_f_1_1_p_d_f_view_ctrl.html#a73681f68b6ad7a98ab02d7faa64d8805

This takes in a FindTextAsyncHandler:

http://www.pdftron.com/pdfnet/PDFNetC/da/dca/classpdftron_1_1_p_d_f_1_1_p_d_f_view_ctrl.html#aad0f4972e7780f416e5c794eb02735ab

Then when you call FindTextAsync, that FindTextAsyncHandler delegate will be called:

http://www.pdftron.com/pdfnet/PDFNetC/da/dca/classpdftron_1_1_p_d_f_1_1_p_d_f_view_ctrl.html#a8e44e443d5b214cdb7ceeec5934606d3

For example, code to search for the string “and” and select the first result would look something like:

void MyFindTextHandler(bool success, Selection select, void custom_data)
{
if (success)
{
PDF::PDFViewCtrl
view = (PDF::PDFViewCtrl*)custom_data;
view->Select(select);
}
}

PDF::PDFViewCtrl view = …
view->SetFindTextHandler(MyFindTextHandler, (void
)view);
view->FindTextAsync(“and”, false, false, false, false);