How can I save a text in a PDF that is a hyperlink to a webpage?

5 views (last 30 days)
I want to create a picture, and add some text to this picture.
This text should be linked to an html link when I create the PDF file through the SAVEAS or PRINT command.
For instance, I would like to add some instruction into the following snippet of code
H_fig=figure('units','centimeters');
text(0.05, 0.95, 0.0,'Mathworks')
saveas(H_fig,'Hyperlink To Mathworks.pdf','pdf')
%%Instruction to add a link
to create a pdf with the text Mathworks linked to the site https://www.mathworks.com/

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 31 Mar 2021
Edited: MathWorks Support Team on 1 Apr 2021
The capability to get a hyperlink, when adding a simple link :e.g., text(0.05, 0.95, 0.0,'http://www.mathworks.co.uk') to an exported figure, is something completely handled by Adobe, and not by our software. 
More information can be found on this thread:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/255010
As a counter example, in MATLAB, you can emulate a hyperlink on a figure by adding a "ButtonDownFcn" callback to the text, but this hypelink will not be exported into the PDF. 
In other words the commands SAVEAS and PRINT work independently from the Adobe Tools (which interprets the figure generated in MATLAB). 
A workaround, is to create a text handle with the name, e.g., 'Mathworks': 
text(0.05, 0.95, 0.0,'Mathworks)
and then you add a hyperlink to 'https://www.mathworks.com', directly from Adobe Acrobat, as the following link shows:
http://blogs.adobe.com/acrolaw/2010/04/creating-hyperlinks-in-adobe-acrobat/

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2013b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!