Just put the code at an appropriate action in the PDF.
I don't want to bring any keyboard or mouse event inside the pdf hosted iframe. But other action suggestion is acceptable as long as I am not losing data inside the ipdf.
There is almost no communication between the PDF and the web browser or OS. If you want this from the PDF then it is easier to put it in the PDF. Other wise you have to work through a plug-in or pass parameters through other services.
You can use the "Open Page" action or a Document level script to issue the alert whenever the page or document is opened.