Creating PDF Links To A Web Catalog
Introduction
It is a common task to generate web links to online "product" pages based on some kind product index or SKU. This tutorial shows how to automatically generate PDF links to a web catalog using the AutoBookmark™ plug-in for the Adobe® Acrobat®.
Prerequisites
You need a copy of Adobe® Acrobat® along with the AutoBookmark™ plug-in installed on your computer in order to use this tutorial. You can download trial versions of both the Adobe® Acrobat® and the AutoBookmark™ plug-in.
Step 1 - Open A PDF File
Start the Adobe® Acrobat® application and open a PDF file using "File > Open…" from the main menu.
Step 2 - Open The "Generate Links By Text Search" Dialog
Select "Plug-Ins > Links > Generate Links > Generate Links By Text Search (Single Rule)..." to open the "Generate Links By Text Search" dialog.
Step 3 - Specify Page Area (Optionally)
Press the "Edit Page Area..." button to specify an area on the page to perform a text search. All text outside of the specified area will be ignored.
Check the "Process text located only in the following area" box. Click "Select Page Area From Sample Page…".
Click and hold the left mouse button while using the Selection tool, then draw a rectangle around an area on the sample page.
Step 4 - Specify Link Appearance (Optionally)
Press the "Edit Appearance..." button to specify desired visual appearance of the resulting links.
Select a link type: visible or invisible rectangle. Select "Invisible Rectangle" if you don’t want users to see the link in the PDF. An invisible link is useful if the link is over an image. Note that the "Line Thickness", "Line Style" and "Color" options are not available if "Invisible Rectangle" is selected.
Select a highlight style: none, invert, outline or inset.
None: doesn’t change the appearance of the link.
Invert: changes the link’s color to its opposite.
Outline: changes the link’s outline color to its opposite.
Inset: creates the appearance of an embossed rectangle.
Select a line thickness: thin, medium or thick.
Select a line style: solid, dashed or underline.
Select a color for the link using the "Color" menu. The color is used only for drawing the link outline. Check the "Change underlying text color to" box and select a desired color from the pull-down menu. Click "OK" to close the dialog.
Step 5 - Specify Search Parameters
The "Find text pattern" and the "Link action" parameters fully control where the link is going to be added as well as the associated link action. The "Find text pattern" expression defines a regular expression that is used to search for a text. The "Link action" string determines what happens when a reader clicks on a link.
For example, if the website "www.mystore.com" has a number of product pages that have SKU as a part of the name, then it is possible to automatically add links to SKUs in the PDF document. Let's assume that SKU is formatted as a single letter that is followed by a 10 digit number (A1234567890 or F1392493420). There are corresponding web pages with the following URLs: "www.mystore.com/A1234567890" and "www.mystore.com/F1392493420". Use the following settings to automatically add web links to every occurrence of SKU in the PDF document:
Specify "Find text pattern": ([A-Z]\d{10})
Link action: URI:http://www.mystore.com/\1
Click "OK" once done.
The dialog will show the total number of links created. Click "OK" to close the dialog.
Step 6 - Inspect The Results
The "Find text pattern" expression will match a single letter ([A-Z]) that is followed by a 10 digit number (\d{10}). The whole expression is enclosed in round brackets ( ) to allow referring back to the search results in the link action. The "Link Action" starts with an URI: prefix. It indicates that the link is going to have an "Open a web link" action. It is followed by a static portion of the web address: http://www.mystore.com/ which is always the same for all links. Next, it is followed by the search results returned by the first matching group (expression enclosed with round brackets) \1. If text search has located F1392493420 SKU in the text, it will add a web link with the following URL: http://www.mystore.com/F1392493420.