0

As explained e.g. here, JavaScript can be added to a pdf using latex.

Can someone provide me with an example, how I can add a JavaScript to an image in the pdf that executes when the image is clicked?

S.H
  • 121

1 Answers1

2
\documentclass{article}
\usepackage{graphics}
\usepackage{media9}
\usepackage{mwe}

\begin{document}

\mediabutton[ 
  jsaction={app.alert('hello world!');}
]{\includegraphics{example-image}}

\end{document}
AlexG
  • 54,894