I am wondering if we could have a pdf file, which can tell what viewer its being viewed with. I was looking for some tex command, which says something like:

If viewer is Acrobat, print "Hi You are viewing this file in acrobat" Else, print "Hi you are not using acrobat".

The reason I need this is because I am using some tex features that require the pdf viewer to have java enabled. So, when the viewer being used is not java enables, the pdf must contain "View this file in Acrobat Reader" .

Is there any macro in any package for detecting if the pdf viewer being used is Acrobat Reader or not.

I hope I am clear.

  • 1
    I know "Don't do that" isn't really an answer, but the lethal combination of java with Acrobat has been open to numerous exploits, and any of your (potential) users with a minimum grounding in Internet Security 101 will simply throw your file into the garbage, Sorry. Mar 11, 2013 at 23:05
  • You're correct, though I don't know much about internet security, I might not want the pdf file to display my id address or even some marginally sensitive network information. I have noticed in some of the fillable-pdfs that we find on the internet, ex. visa forms, etc, which mostly work in Acrobat (and other java enabled viewers), when we try to open the file using an inappropriate viewer, it says - "Use Adobe Acrobat to View this file". Hope I am right. Though am no way an expert on internet security, I take your opinion for it. Mar 11, 2013 at 23:14
  • related question How to include interactive java-based web pages inside LaTeX generated PDF documents.@PavithranIyer did you see javascript tag for more related ones Mar 11, 2013 at 23:58
  • 2
    One important thing to realize here is that java and javascript are two completely different languages which don't relate to each other in any way (other than similar name)!
    – morbusg
    Mar 12, 2013 at 9:11
  • 1
    Yes, I'm sorry if it seems harsh, but the exploits I'm talking about aren't just displaying sensitive information -- they're about taking over your computer and using it to send spam, steal from your bank account, encrypt all your files and then demand a ransom, and a multitude of other evils. Mar 12, 2013 at 12:43

1 Answer 1


PDF as defined in the PDF norm has no facilities for viewer-dependent content. Its main goal is to be viewer-independent.

So your only option are JavaScript actions supported by some viewers (notably Adobe's). AFAIK Java is not supported by any PDF viewers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .