is now part of CreativePro.com!

Creating Relative Hyperlinks in InDesign

11

With InDesign you can create hyperlinks to PDF files that reside on your file server or local hard drive. The trouble is, when you create a PDF of the InDesign file, those hyperlinks point to the absolute, fixed path to those files on your server or local hard drive, which makes it next to impossible to share the PDF with anyone else in a meaningful way. David wrote about this problem way back in 2010.

I revisited this problem recently at the request of a client who needed to create a giant in-house reference guide with hundreds of links to PDF files that resided on their file server. The hyperlinks they were creating weren’t working because different users had different drive letters mapped to different paths on the server. Furthermore, they were concerned about the links continuing to work in the future if changes were made to the top-level drives and folders on the server.

In my research and testing, I discovered that things have changed! You can now create “relative links” to PDFs in InDesign. But it is far from obvious how to do so. Here’s the trick.

1. Create a folder structure that will hold all of your linked PDF files, as well as the InDesign file and the exported PDF file that will contain all the links. How this folder structure is organized isn’t important. What is important is that the folder structure never change, and the location of the exported PDF relative to the linked PDFs never change. For example, in the folder structure below, I want to create buttons in the “Reference Guide.pdf” that link to PDFs in the “Tables”, “Safety”, and “High pressure valves” folders. Later, I’ll be able to move or copy the “Marketing” folder (the parent folder of all my other folders related to this project) wherever I want, but I won’t be able to rename or move the folders within the Marketing folder after I’ve created my links.

     

2. Create your InDesign file in the location where you want the final PDF to be exported. In this case, I created the “Reference Guide.indd” file in the “Reference Guide” folder, which is where I want the final “Reference Guide.pdf” file to end up.

3. In your InDesign file, create a button (not a hyperlink) with the “Open File” action.

4. Click the folder icon, and select a PDF that resides in the folder structure you created in step 1. The full path to the linked PDF will display in the panel, which makes it look like InDesign is creating an absolute link, not a relative link. But trust me, this will work.

5. After you’ve created all of your buttons, export your InDesign file as an Interactive PDF. You must use the Adobe PDF (Interactive) format, since button actions aren’t exported with the Adobe PDF (Print) format.

6. Test the buttons in Acrobat or Acrobat Reader. They should work. If you dig around in Acrobat and examine the properties of one of your buttons, you’ll see that the button appears to contain an absolute link to the pdf on your hard drive or server. But again, trust me, this works.

7. Now, to give the links a real test, move the entire parent folder (in my example, the entire folder named “Marketing”) to a flash drive or a different location on your server. You can remove the InDesign file and any folders and files that aren’t referenced in the PDF from the folder structure if you wish.

8. Open the PDF that contains the buttons, and test them. The buttons to linked PDFs will still work, even though the linked PDFs now reside in a new location!

I did all my testing in InDesign CC 2018 version 13.0.1. However, I think its a safe bet this isn’t a recent change…I believe it goes back quite a few versions. I’ve tested this cross-platform, between Macintosh and Windows, and it works well.

Limitations

This won’t work on mobile PDF readers, since most mobile PDF readers don’t support buttons, and even if they do, mobile devices don’t have a file system equivalent to a full computer.

Also, there isn’t any way that I know of to specify in the button link that you want the linked PDF to open in a new window or tab. However, in Acrobat Preferences, you can control this behavior with the Open cross-document links in same window option in Preferences.

Keith Gilbert is a design consultant, developer, educator, speaker, and author. His work has taken him throughout North America, Africa, Europe, and Asia. During his 35+ year career his clients have included Adobe, Apple, Target, Oracle, and the United Nations. He is the author of several popular titles for LinkedIn Learning, Adobe Press, and CreativePro. Find him at gilbertconsulting.com and on Twitter @gilbertconsult
  • David Blatner says:

    Keith, this is amazing!

  • Anne-Marie Concepcion says:

    Wow, great discovery! I used to do all my linking to other PDFs after the fact, in the exported “master doc” PDF, using Acrobat’s linking features. This makes life easier.

  • Jeff Witchel says:

    Cool! Thanks Keith!

  • Lisa says:

    awsome, thank you!

  • Marvelous bit of detective work! Funny how these kinds of changes sneak in without anyone being the wiser until a real-life problem flushes them out.

  • Jens Peters says:

    That’s a helpful one, Keith, thank you!
    In my company, we’ve got a similar topic: Can one create relative hyperlinks from one indd file to another? It seems that, when you create page references between indd files, absolute hyperlinks are created. So, when you copy a project to update it, the page numbers refer to the original documents instead of the newly created ones.
    I edited the hyperlinks according to David’s tip from Nov, 2010 (indd -> idml -> zip -> designmap.xml), but now the page seems to restart with every document inside the book instead of “counting through” (sorry, I’m not a native speaker).
    Any ideas? Or would it be more practical to open a new thread in the forum for this topic?
    Best, Jens

  • Jens Peters says:

    Update from this morning: After restarting InDesign (CS6, btw.) and creating a new book, the page numbers now are displayed correctly. I already did this twice yesterday, but without success.
    So, this part of the problem’s kinda solved itself.

  • Jens Peters says:

    Me again — I cheered too soon… The problem with the wrong page numbers persists. Bummer…

  • Helal Uddin says:

    Hi Sir,

    Do you make a video tutorial on this subject?

  • Helal Uddin says:

    Is it not work If I move the parent PDF file anywhere without linked pdf file? I made a sample. It’s working when I save the pdf in the same folder where I put other linked pdf. But when I move the Main pdf anywhere on my drive isn’t working.

  • Jeremy Thompson says:

    Hi. Thanks for this. Found a workaround to the Opening and closing pdf issue. As you cant change the preferences of other users ‘Acrobat’ to open a new window rather than close the original, instead I put a basic button in each pdf that was linked to the original to open the original. This allow them to switch back and forth even when acrobat closes the previous file.

    Hope this helps

  • >
    Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo