Embed Relative Paths to external files in a .pdf
Problem:
So I was given a pdf table, which was mapping .pdf resources onto specific days (instructional media planning thing). The naming conventions were rather painful, so looking for all those files anytime I wanted to make sure they were in the right place got tiresome.
So I figured I would embed links to those files so that they automatically open. Normally I would just embed links to internet location of the external files.
However, for security reasons, I could not place the files online. Period. So I had to figure out how to embed relarive paths, otherwise the file would only be useful to me and only me and not to my colleagues with their various machines.
case scenario: I have a document testsource.pdf and I want to embed in it a link to testtarget.pdf (and NOT C:\folder\testtarget.pdf
Note that Mac, Linux, and PC have similar relative path conventions; though not absolute path conventions. That's good for us. *
Solution
Long story short, just use some sort of custom hyperlink and simply point to "testtarget.pdf"
BUT: beware that all the pdf programs I tried (pdf Xchange Viewer, Acrobat, Viewer, Foxit) will be showing the relative path as absolute when you hover over or click. Thus, I though the program was automatically converting to absolute paths, but in fact it's just a display gimmick. It's still relative behind the scenes.
I just wish I realized this before I went on the quest starting with testing eight various ways of writing relative paths and ending with coding into the pdf an open file action with JavaScript and functions to build up the absolute path on fly (using app.open and doc.path)
True story :-)
*
Platform
Local Platform Path
Acrobat Device Independent Path
Windows
C:\MyFolder\MyFile.pdf
/C/MyFolder/MyFile.pdf
Macintosh
MyDisk:MyFolder:MyFile.pdf
/MyDisk/MyFolder/MyFile.pdf
UNIX
/user/me/MyFolder/MyFile.pdf
/user/me/MyFolder/MyFile.pdf


















