I am preparing a presentation on the compiler Texmaker "documentclass" in "beamer". I was fascinated with the package "multimedia" which is a solution to include movies in the presentation.

Question: Is there any solution to include Java Applets in presentations/beamers or a link to webpage?


  • Perhaps related: tex.stackexchange.com/questions/70989/… Commented Feb 21, 2013 at 16:29
  • For an applet in the PDF you would have to use a JRE like in the Post Paulo linked. For a simple Link to a website you could use the hyperref package.
    – Dave
    Commented Feb 21, 2013 at 16:36
  • 1
    Flash (Flex) can be embeded in pdf. : link
    – La Raison
    Commented Feb 21, 2013 at 16:50
  • 1
    multimedia is outdated in terms of standards. You should use media9 instead.
    – AlexG
    Commented Feb 25, 2013 at 12:38

2 Answers 2


You could create an entirely new backend for Tex that embeds a JVM or similar runtime environment. This JavaTeX would be a lot of work, and I guess you are talking about embedding Java applets in PDFs, instead, which can't be done. The resulting documents would be dangerous, since they could be artificially intelligent, and there would be no viewer support, so you would have to implement your own (a.k.a. Trojans).

You can embed the wholly unrelated technology of Javascript, by attaching Javascript methods to Rich Media objects embedded into one of the more dangerous levels of PDF. This is also a Bad Thing. But if you really wanted to do it, it would be quite a bit of work: I think you would have to inject all the code yourself using PDF specials, since, besides embedding Rich Media using the media9 package, there is no support for this as far as I know. A very suitable form of Rich Media for this terrible deed would be Flash, since the Flash controls can be controlled by Javascript methods. But this would be very much easier that creating the JavaTeX suite. There are very few viewers that support Javascript-controlled Rich Media.

You do not need any of these bad, dangerous things to create dynamic PDFs, since PDFs support layers that can be switched on and off interactively - this is called Interactive PDF, and there is some support for this in Context. There may also be support in Latex via a package.


You can create Interactive PDFs in Latex using the insdljs package, which is part of Acrotex suite, and depends on the hyperlink package to inject javascript into links. This is quite clean, although creatingInteractive PDFs in this way requires a substantial understanding of Adobe's PDF object model, and so is rather harder to do than Context layers. Yiannis gives a nice example in his answer to How to make interactive PDF documents with TeX?.

Do note that relatively few PDF viewers support interactive features, and only Adobe Reader supports the whole of the PDF object model.

  • Stewart, I update your answer. Not quite what I expected but it was by itself sufficient to their feet. But I'm still hoping for a solution. Thanks for your reply. Commented Feb 23, 2013 at 15:07
  • 2
    @Elias: I would be very surprised if there is a Tex engine that produces documents embedding Java applets together with a viewer that is capable of viewing these documents and running the applets. It seems unlikely that someone would invest the considerable effort to create such a system and then not make its existence known. Commented Feb 23, 2013 at 16:18

You cannot play Java applications inside PDF inside AdobeReader (currently being the feature-richest PDF viewer). You will have to (re-)write such applications in Flex and compile them to Flash (SWF), using the (open-source) Flex-SDK.

Only Flash is supported by AdobeReader. It uses a virtual machine commonly known as FlashPlayer for playback. Follow LaRaison's link in her comment to your question for an example of interactive Flash inside a PDF.

You must log in to answer this question.

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