Assume I have a file on my machine at file:///c:\figure.bmp.
From my pdf document, that is created by LaTeX using hyperref.sty, how can I open figure.bmp
using mspaint.exe
(microsoft built-in image editor)?
What is the correct command to do this scenario?
If I call as follows
\href{file:///c:\figure.bmp}{To open the figure, click here.}
the figure.bmp
will be opened using Illustrator (for example).
Actually I can change the file association to open bmp using mspaint instead of illustrator. But, I prefer to find another elegant approach, i.e., by specifying both file to be opened and the application used to open.
Best Answer
It looks like you want a "Launch" action; see Table 8.49 (p. 622) in Section 8.5.3 of the PDF Reference, version 1.6, or Table 8.53 (p. 660) in the same section of version 1.7.
Both versions can be obtained from the Adobe PDF Reference Archive; due to size, version 1.6 (8.8 MiB) might be preferred over version 1.7 (31 MiB). (The ISO standard should be avoided like the plague due to its poor typography.)
It looks like the easiest way to actually use this is to use the pdfLaTeX primitives
\pdfstartlink
and\pdfendlink
; see the manual on the pdfTeX page.Update:
Well, it didn't turn out to be particularly easy, but here is a complete example that almost works for me -- it seems to be interpreted correctly, but fails because (according to Reader) "it is currently disallowed by your system administrator".
(This might seem obvious, but the following is in the "plain" format, not LaTeX -- it's what they call a SpikeSolution.)
Oh, and a warning: I wouldn't suggest testing modifications of this in Adobe's Reader initially; when I tried it on a slightly malformed file, it would forget to close the file when I closed the window, so I would have to close Reader itself before I could re-run TeX. Instead, try it in gsview32, which has the added advantage of giving some sort of diagnostics rather than just not woring.