TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
Perhaps related: tex.stackexchange.com/questions/70989/… – Paulo Cereda Feb 21 '13 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 Feb 21 '13 at 16:36
Flash (Flex) can be embeded in pdf. : link – La Raison Feb 21 '13 at 16:50
multimedia is outdated in terms of standards. You should use media9 instead. – AlexG Feb 25 '13 at 12:38
up vote 3 down vote accepted

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.

share|improve this answer
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. – MathOverview Feb 23 '13 at 15:07
@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. – Charles Stewart Feb 23 '13 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.