Adding Links to PDF Documents with AutoBookmark™
Introduction
The AutoBookmark™ plug-in for Adobe® Acrobat® provides multiple ways of automatic generation of hyperlinks in PDF documents. One of the most basic methods is a "link dictionary" approach. It is designed to add links to a predefined set of words and phrases. A link dictionary is a collection of search terms (words, phrases) and corresponding actions (such as "Go to a page view" or "Open a web page"). The software searches a PDF document for occurrences of specific search terms and generates links according to user specifications. Link dictionaries can be created manually using a supplied editor, imported from a text file or generated from bookmarks.
The following diagram illustrates the concept of automatic link generation from a link dictionary:
Linking by dictionary
What is PDF Link?
PDF format supports link annotations, also known as simply links or hyperlinks. Link is a rectangular area that can be placed anywhere on the page. Each link has a corresponding PDF action associated with it. This action is executed when user clicks in the link area. Unlike HTML hyperlinks, PDF links are not associated with any other page elements. Link is just hot-spot with an associated action. It can completely invisible or it can appear as a rectangle or a line to provide a visual clue. Here are few link samples:
Link examples
The AutoBookmark can change the color of the underlying text covered by the link. This function is not provided by the core Adobe Acrobat.
Supported Action Types
The "Create Links From Dictionary" operation provided by AutoBookmark allows creating PDF links with the following actions:
  • Go to a page in the same PDF document
  • Go to a named destination in the same PDF document
  • Go to a page number in another PDF document
  • Go to a named destination in another PDF document
  • Open a web link
  • Open another file or document
  • Go to a page in PDF attachment
  • Execute a menu item
  • Execute JavaScript
Contents
Step 1 - Creating a Link Dictionary ↑overview
Start Adobe Acrobat and open a PDF file you want to process. Select "Plug-ins > Links > Create Links From Dictionary..." from the main menu. This will open "Create Links From Dictionary" dialog. Press "Create New Dictionary" button to open a link editor. If you already have a previously created dictionary, then press "Browse..." button to load it.
Step 2 - Adding Search Items to Link Dictionary
Link dictionary is a collection of search text items and corresponding actions. Press "Add..." button to add a new search item to the dictionary. The AutoBookmark will use these descriptions to search PDF documents for these search terms and add corresponding hyperlinks.
Step 3.1 - Linking to a Page View (example) ↑overview
Pressing "Add..." button in "Edit Link Dictionary" dialog opens "Edit Link Action" screen. Type a text to search for into "Text to add link to" box. In the example below, it is "Adipine". Next, select a desired "Action type" using corresponding pull down menu (select "Go to a page view" if it is necessary to display a page inside the same document). Enter a destination page number or specify a named destination to display. Press OK button to save this search item into the dictionary.
Step 3.2 - Linking to a Page in Another PDF Document (example) ↑overview
Pressing "Add..." button in "Edit Link Dictionary" dialog opens "Edit Link Action" screen. Type a text to search for into "Text to add link to" box. In the example below, it is "Adipine". Next, select a desired "Action type" using corresponding pull down menu (select "Go to a page in another document" if it is necessary to display a page in another PDF document). Enter a destination page number or specify a named destination to display. Type a filename into "Document name" box. You can specify a target file location using either relative or full path to the file. No matter what method you will use, the resulting link will always use a relative file path (if technically possible).
Examples of the file paths:
  • If a destination file is located in the same folder, then just enter a filename. For example: MyDocument.pdf
  • If it it necessary to link to a file located in a sub-folder, then type SubFolderName/FileName.pdf.
  • Use absolute file path if you want to use a link dictionary on PDF files located in different folders. For example: c:/Data/Docs/MyDocument.pdf
IMPORTANT: if you are planning to use a link dictionary on files that are located in different folders, then you must enter absolute file paths into the linking dictionary. This is because there is no single relative file path that will work for different files located in different folders while referring to the same file. You would have to specify a full path and let software to automatically convert the path into appropriate relative path for each file being processed. For example, if we need to automatically add links in two files: c:\Data\A.pdf and c:\Data\Docs\B.pdf that point to a third file located in c:\Data\Index\C.pdf, then we must specify a full path to C.pdf in the link dictionary. This is because relative paths from A.pdf and B.pdf to C.pdf are different. If an absolute path is used, then the relative path to C.pdf will be automatically resolved to a correct value for A.pdf and B.pdf and the resulting links will work properly.
Press OK button to save this search item into the dictionary.
Step 3.3 - Linking to a Web Page (example) ↑overview
Pressing "Add..." button in "Edit Link Dictionary" dialog opens "Edit Link Action" screen. Type a text to search for into "Text to add link to" box. In the example below, it is "Adipine". Next, select a desired "Action type" using corresponding pull down menu (select "Open a web page" if it is necessary to display a web page). Type web page address into "URL" box and select required protocol from the pulldown menu. Leave it as "http://" if you just want to add a regular web link. Press OK button to save this search item into the dictionary.
Step 4 - Building Link Dictionary ↑overview
Click "Add..." button (repeat step 3) multiple times - once for every search term you need to add to the dictionary. The screenshot below shows a link dictionary that contains multiple search terms with "Open a web page" action.
Press OK button once the link dictionary is complete. If this is a new dictionary, then you would be prompted to save it to disk.
Importing Link Dictionary from Text
An alternative to creating a link dictionary in the "Edit Link Dictionary" dialog is to prepare it in a spreadsheet application (such as Microsoft Excel) or using a plain text editor (such as Notepad). The text file can be imported into the application via "Import From Text" button. The import file syntax conforms to CSV plain text file format that is widely used for the data exchange.
Generating Link Dictionary From Bookmarks
The most effective method for automatic generation of a link dictionary is from the existing bookmarks. Press "From Bookmarks..." button to add existing bookmarks as link dictionary entries. Bookmark titles are added as the search terms and bookmark actions are used as corresponding link actions.
Step 5 - Specifying Link Appearance ↑overview
Press "Edit Appearance..." button to define a visual appearance of hyperlinks. This style will be applied to all hyperlinks created with this link dictionary.
Use "Edit Link Appearance" dialog to configure visual appearance:
The software allows changing the color of underlying text elements. Please note that in PDF format, text and links are two separate and unrelated entities. Deleting the links will not change the color of the text back.
Press OK button once done to close this dialog.
Step 6 - Selecting Processing Page Range (Optional) ↑overview
Press "Edit Page Range..." button to select a range of pages where to add links.
Use "Select Page Range" dialog to specify a page range either directly by providing page numbers or indirectly via bookmarks, named destinations, or page labels. Indirect page referencing provides a powerful mechanism for customized document processing.
PressOK button once done selecting a page range.
Step 7 - Selecting Processing Page Area (Optional) ↑overview
Sometimes it is necessary to limit processing only to a specific area on the page. Press "Edit Page Area..." button to specify processing area.
Use "Processing Area" dialog to enter coordinates of the processing area:
PressOK button once done selecting a processing area.
Step 8 - Generating Links ↑overview
Press OK button to start generating links for the current document. All settings are automatically saved as part of the link dictionary. Use "Browse..." button to load a previosly saved dictionary.
Important: if a part of the text is already covered by an existing link, then a new link is not added to this area. Use "Plug-ins > Links > Delete Links" menu to delete links prior to processing if necessary.
Step 9 - Inspecting the Results ↑overview
Inspect and test resulting links once processing is completed.
Using Action Wizard to Process Multiple PDF Documents ↑overview
The Adobe Acrobat Pro comes with a powerful batch processing tool called "Action Wizard". It is also known as "batch processing" in the older versions of Adobe Acrobat. The AutoBookmark Pro plug-in adds most of its functionality as batch commands to the Action Wizard. Use the following tutorial to learn how to use Action Wizard to create powerful batch actions. The Action Wizard makes possible to process multiple files at once without the need to manually open the files and use menus and dialogs. Many different types of processing can be completely automated with the help of Action Wizard. Once a processing action is created, it can be re-used with a single click.
Here is a brief tutorial on using "Create Links From Dictionary" command with Action Wizard.
Select "Action Wizard" tool from the Tools panel and press "New Action..." on the toolbar:
Use Action Wizard tool
Add "Create Links From Dictionary" command to the action steps. The command is located in the "More Tools" category. Press "Specify Settings" icon to configure the command parameters. It is identical to using the "Plug-ins > Links > Create Links From Dictionary" menu.
Creating links from dictionary in Action Wizard
The action can be configured to run on the "currently open file", or on the specific file(s) and/or folders. If you want to restrict the action to run only on the specific files/folders, then press file or folder icons located in the "File to be Processed" section.
Select input file
The next step is to add "Save" command to the action steps to save changes for the document. It is located in "Save & Export" category:
Add Save command
Now press "Save" button to save the action. Enter the Action Name and optional description:
Name the action
Now the action is saved and can be executed from the Action Wizard panel.