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?

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

\begin{document}

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

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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