Linking to Pages or Destinations Within PDF for HTML
A common question that arises time and time again is “How can I make a link to a specific page or destination within a PDF from my webpage?” It is straightforward and a similar process to linking to any URL.
Let’s use A Christmas Carol by Charles Dickens, hosted on www.planetpublish.com for our first example.
Linking to a specific PDF page in a webpage
This is a simple method of linking that doesn’t require any editing of the original PDF document. It is the same as linking to any webpage. The first step is the same as the normal linking process, just copying the link
The next step is to link to the specific page in the PDF.
Using the same PDF as an example we want to link to the first page of the story which appears on page 3 we use a ‘#page=’ followed by the desired page number affixed to the end of the link.
The HTML link then becomes
<a href='http://www.planetpublish.com/wp-content/uploads/2011/08/A_Christmas_Carol_NT.pdf#page=3”> Linked Text</a>
Linking to a destination within PDF in a webpage
Linking to a destination is essentially the same principle but involves a few more steps and setting up. First up, you’ll need to create the destination.
Creating a destination in a PDF using Adobe Acrobat:
- Manually navigate through the PDF for the desired location, and magnification.
- Move your curser to the right of the PDF, in the navigation pane.
- Right click and select ‘destination’. This will open the Destinations pane.
- Right click, select ‘New Destination’ enter an appropriate name and select the area that you want the destination to link to.
NOTE: Make sure that the name does not have any spaces as it makes it easier to link to afterwards.
You are now ready to link to the destination using a similar syntax as linking to a specific page, instead of #page write ‘#nameddest’.
Append ‘#nameddest=’ and the name of your chosen destination. So, if your PDF has a named destination, ‘TOC’, that points to a table of contents, then your link code will look like this:
<a href='http://www.mydomain.com/myPDF.pdf#nameddest=TOC'>Link Text</a>
Checking the links within a PDF
Making sure that the links are connected to the right places in your PDF is very important for usability and navigation.
Adobe Acrobat Pro 11 has a dead-link checker built in as standard, which will highlight all dead links on a page.
A better tool for this task can be found in Debenu PDF Aerialist, a powerful Adobe Acrobat plug-in. Contained in the ‘Link’ feature, reports can be generated for ‘Bad Actions’, ‘Bookmarks’, ‘All links’, ‘External Dependencies’, ‘Selected Link’, and Count Links’.
In addition to that audits can be generated on all links and bookmarks to find any broken link actions in the current PDF.
Article originally written by Dan Shea, for Adobe Acrobat 4, revised and edited for Adobe Acrobat 11