2

As I asked here, I'm trying to add a link to an image, which already works this way:

\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}

\let\oldincludegraphics=\includegraphics
\renewcommand{\includegraphics}[2][]{\href{#2}{\oldincludegraphics[#1]{#2}}}

\begin{document}
\noindent\centering\includegraphics[width=\textwidth]{test.pdf}
\end{document}

Now, I'd like to call

explorer.exe /select,./../path/to/file/file.ext

when the image is clicked, i.e. I want the explorer to open and highlight that file.

Is there a way to do that?

EDIT:

I found here some code for "providing a link that activates a php script through localhost":

function pdflatex($data=''){
        if (!empty($_POST)){
            $code=$_POST['ascript'];
        }
        //$f='ZZZ.tex';
        //$res = file_put_contents('C:/latex-samples/'.$f, trim($code));
        //ob_start();
        $t='pdflatex.exe  c:/latex-samples/ZZZ.tex 2>&1';
        echo '<pre>'.shell_exec($t).'<pre>';
    }

but, frankly, I do not understand how to use this for my purpose.

Maybe someone can give me a hint?

Best, Ben

S.H
  • 121

0 Answers0