[Tex/LaTex] ny solution to include Java Applets in presentations/beamers

beamerjavajavascript

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?

Thank's.

Best Answer

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.

Postscript

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.