Sometimes maybe you want to detect a PDF is opened by Foxit or other PDF Reader, so we can use javascript code to do it.
For example, we add the javascript code to Document Actions as shown below.
Then when you close the file, we can see that the file is opened in Foxit PDF Editor.
And if the file is opened in other PDF reader, there will be a prompt for undefined.