2
$\begingroup$

I would like to view a designated PDF document by clicking on a hyperlink in a Mathematica notebook.

I am able to open the designated PDF document using SystemOpen["E:\OneDrive\Learning Mathematica\Tutorial.pdf"] which opens the document using the system default PDF viewer configured on my local machine. This is acceptable. My only problem is that I don't want to see the SystemOpen[] command in my notebook cell. I want to launch the PDF document viewer by clicking on a hyperlink (or something similar) which I am able to label with some user friendly text.

$\endgroup$

1 Answer 1

1
$\begingroup$
url = "C:\\Program Files\\Wolfram Research\\Mathematica\\11.3\\Documentation\\English\\
 System\\ExampleData\\mathematica.pdf"; 

Button[Style["mathematica.pdf", "Subsection"], SystemOpen[url], 
 Appearance -> "Frameless"]

enter image description here

To replace the input cell (url = ...; Button[...]) with the button object, highlight the cell contents and, then either (1) select Evaluate in Place from the Evaluation menu, or (2) use the keyboard short-cut Ctrl+Shift+Enter.

$\endgroup$
1
  • $\begingroup$ Thank you. Worked perfectly. Very instructive! $\endgroup$
    – tedh
    Jun 26, 2020 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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