4

Is there a way to link to an external application (so that it starts) when clicking on a link in a PDF file, e.g. in a beamer class LaTeX file?

1

3 Answers 3

4

I usually use the movie command of the multimedia package to open any video, audio, image file in an external viewer. But no, it will not open programs.

\frame{    
\movie[externalviewer]{Audio Title}{audio.wav}
\movie[externalviewer]{Video Title}{video.mp4}
\movie[externalviewer]{Image Title}{image.jpg}
\movie[externalviewer]{PDF Title}{doc.pdf}
\movie[externalviewer]{Gedit}{/usr/bin/gedit} % does not work
}
2

It is possible! The following works well with my Acrobat, involves a bit PDF hacking. Just tested it on my Mac, you have to adjust it according your platform. Simply define the following macro

\newcommand{\LaunchBinary}[2]{%
  % #1: layer name,
  % #2: link text
  \leavevmode%
  \pdfstartlink user {
    /Subtype /Link
    /Border [0 0 0]%
    /A <<
      /F <<
         /DOS (xxx)
         /Unix (xxx)
         /Mac (#1)
      >>
      /S /Launch
    >>
  }#2%
  \pdfendlink%
}

Fix the "xxx" to maybe #1 as well or rewrite it to suit your need. Then, to add a link somewhere in the PDF called "Start" which launches "demos/1/Wave1D.app", just

\LaunchBinary{demos/1/Wave1D.app}{Start}

This works well even for beamer class. With this, I can directly launch demo apps from a fullscreen presentation. Awesome!

Note again, though, this apparently only works with Adobe Acrobat (Reader). MacOS "Preview" does not work.

1
  • +1 Worked beautifully on Mac OS X (10.7.2) with Adobe Reader.
    – Cyrus S
    Apr 19, 2012 at 11:48
0

I'm quite sure you can't. It's very application-dependent, system-dependent, and other-1000-things-dependent.

Afaik only url works quite well...

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