# Prevent Search Box from opening on UI when using searchText

**URL:** <https://pdfjs.community/t/prevent-search-box-from-opening-on-ui-when-using-searchtext/2031>\
**Category:** Technical Support\
**Created:** [September 15, 2022, 8:14am UTC](https://pdfjs.community/t/prevent-search-box-from-opening-on-ui-when-using-searchtext/2031 "2022-09-15T08:14:21Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dcheli](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@dcheli](https://pdfjs.community/u/dcheli)\
**Post date:** [September 15, 2022, 8:14am UTC](https://pdfjs.community/t/prevent-search-box-from-opening-on-ui-when-using-searchtext/2031/1 "2022-09-15T08:14:21Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8

**Detailed description of issue**  
In my use case, on the documentLoaded event, I am initiating a search for a particular pattern, using the below method:

instance.UI.searchText(searchPattern, searchOptions);

The UI behavior is that the Search Box open, displaying the searchPattern and the found text is highlighted.

Is there a setting to not open the Search Box in the UI and not highlight the text. What I’m trying to do is find the text, get it’s position and draw an annotation.  
Thanks

**Expected behaviour**  
{Provide a screenshot or description of the expected behaviour}

**Does your issue happen with every document, or just one?**  
{Answer here}

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
{Provide a relevant code snippet}

---

_[View the full topic](https://pdfjs.community/t/prevent-search-box-from-opening-on-ui-when-using-searchtext/2031)._
