The pdf document will display in the iframe tag. When the page loads will send one text. In case text is found in the pdf then it should be highlighted in the pdf into the iframe. I am able to show the PDF document in the iframe. But I am not able to find how to highlight the text. Could you please help with this issue using javascript?
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<script type="text/javascript">
</script>
<iframe id="myIFrame" width="100%" height="500px"src = "http://www.africau.edu/images/default/sample.pdf#page=1"; ></iframe>
</body>
</html>
When you serve a PDF it is no longer yours to edit, it is now in the ownership of the client, and they can edit it their own application/pdf way. Therefore you cannot run JavaScript inside their device it would breach their ownership rights. However Acrobat or other commercial methods may allow you to offer to interact via a fragment such as search.
In Acrobat browser Plug-in you can specify #search=word but unless you are an intranet server you can not insist your users are only using Acrobat, or any other paid for solution. But the same function can be used in FireFox (with PDF.js, so not all Mozilla browsers). Thus to trigger highlighting Simple in Firefox change your code to:-
<iframe id="myIFrame" width="100%" height="500px" src="http://www.africau.edu/images/default/sample.pdf#search=Simple"; ></iframe>
However it does NOT appear to work for more secure Chromium/Edge/Opera etc. and not all FireFox variants may show a PDF, here CyberFox is set to secured.