Finding surrounding text around the search term

Q:

The search function in the webreader is awesome and provides a snippet of the text before, and after the match right with the search result.

Is there a smiliar function for the PDFNet SDK (we are using iOS SDK)?

A:

You can use the TextSearch class to find text surrounding a found term, which we call the “ambient string”. Please see the documentation for more info:

Relevant text search methods:

http://www.pdftron.com/pdfnet/mobile/iOSHTMLDoc/src/interface_text_search.html#a7fd0dbe486d4df5ebc3faa5ec6c8deae

TextSearchModes:

http://www.pdftron.com/pdfnet/mobile/iOSHTMLDoc/src/_p_d_f_net_o_b_j_c_8h.html#a9f2679389e07760a0dc54a5e7abb9e24

You will want to include e_ambient_string when you search.