'Is it possible/sensible to embed a relative *web* URL in a .pdf document?

Is it possible (or even sensible) to embed a relative web URL in a .pdf document?

For example, I would like to embed the equivalent of <a href="foo_solution.pdf">(solution)</a> inside foo.pdf so that when I view foo.pdf in a web browser, I can click on a link and it will load foo_solution.pdf. I don't want to encode the full URL in the .pdf so I can move the files without breaking the links. (That means I want to avoid setting baseurl to a specific web address.)

If I generate a .pdf that contains /URI the link works in Chrome, but not in Safari:

/A<</URI(foo_solutions.pdf)
/S/URI>>
/Subtype/Link>>endobj

(In addition, I can't figure out how to generate link text that is different from the URI.)

If I generate a.pdf that contains /GoToR, the link doesn't work in either Chrome or Safari. (I'm guessing because the link doesn't begin with http.)

/A<</S/GoToR
/D [0 /Fit]
/F(nr3_sample_solutions.pdf)>>
/Subtype/Link>>endobj

For what it's worth, I'm using Latex. I used \url and \href respectively to generate the code above.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source