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?

Mathias Soeken
  • 1,293
  • 2
  • 8
  • 22

3 Answers3

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
}
japreiss
  • 11,111
  • 2
  • 40
  • 77
Steve Tjoa
  • 59,122
  • 18
  • 90
  • 101
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.

zerm
  • 2,812
  • 25
  • 17
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...

Enrico Carlesso
  • 6,818
  • 4
  • 34
  • 42