UC Santa CruzInstructional Computing
ITS Home About ITS IC Services News Tutorials Technologies About IC Help

Tutorials - Linking to Specific Pages in a PDF File

Introduction
Basic Overview and Glossary
Making a Destination
Linking to a Destination
Linking to a Specific Page
Other PDF Commands

Introduction

Note: This tutorial is the quick-and-dirty method for linking to a PDF. If you would like to learn more about PDFs in general from the authoritative source, please visit Adobe's Website.

This document will teach you all about linking to PDF (Portable Document Format) files from a webpage. You can link to specific pages or bookmarks in a PDF file, and also perform other commands (like zooming in and out). The tutorial assumes a basic knowledge of HTML and PDF files. If you would like to learn more about creating PDF files, please visit the Convert documents to PDF format with Adobe Distiller tutorial. If you would like to learn more about HTML and creating webpages, please visit the Making a Web Page resources on our how to page.

Basic Overview

A PDF file has navigational constructs called destinations. These destinations specify a certain page to display and also at which magnification to display it. They differ slightly from bookmarks, which are of no use to us at the moment because you cannot link to a bookmark from an outside source. However, you can link to a destination from an outside source, such as a webpage. This is what we want to do.

Making a Destination

To make a destination, open your PDF file in Adobe Acrobat (or Adobe Distiller, whichever you have.)

Find the page you would like to link the destination to, and make sure the magnification displays as much of the page as you would like. (What you see is exactly what the user will see when they follow your destination, so if you would like to zoom out to see the whole page, make sure you do that before the next step. The user can of course zoom in and out at their leisure, but this is what it will initially look like.)

This step differs in the two programs, Acrobat or Distiller, but the rest of the steps are the same:

If you are using Distiller, click on Window->Destinations.

Otherwise, if you are using Acrobat, click on View->Navigation Tabs->Destinations

Distiller:

Acrobat:

Acrobat

Now the procedure is the same in either program: You must scan the document for any already existing destinations before you can add your own, so click the Scan Document button on the Destinations palette.

Then you may click Create New Destination. Give the destination a name that describes where you are (you will use this name in the linking step.) Here I am calling it "testination."

Congratulations! You have just added a destination to your PDF file. Save it and exit Acrobat.

Linking to a Destination

Now that you have a destination, you may link to it directly from your webpage. When the user clicks on the link, the PDF file will open to the page and magnification you specified in your destination.

To add the link, open your HTML file in your favorite HTML editor. Here I am using Dreamweaver.

Make a link that points to your PDF file, and immediately after the file name type :

#nameddest=testination

Your HTML link will look like:

<a href="mydoc.pdf#nameddest=testination">My Link</a>

Or in Dreamweaver it will look like:

Where mydoc.pdf is the name of your PDF file and testination is the name of your destination you made in the last step. The #nameddest= part is a command that tells Adobe Acrobat to "go to this destination when opening this file."

Hurray! You have just linked to a certain destination in your PDF file. Now you may save your page and upload it. Also make sure to upload your PDF file in the correct directory. You may now end the tutorial here or keep reading for other ways to use these PDF commands.

Linking to a Specific Page

If you do not want to link to a specific destination, you may tell Acrobat to open the PDF at a specific page instead. The drawback of this method is that if you add more pages to your PDF file later, you may not be linking to the page you want. Using a destination ensures that the PDF will open up to the exact place you want, no matter how many modifiactions you make to it.

To link to a specific page, simply make a link in your webpage that says:

<a href="mydoc.pdf#page=3">My Link</a>

This will open mydoc.pdf and immediately go to page 3. You can do much more with these commands than just link to a certain page. If you would like to experiment, read on to learn all the commands available for Adobe Acrobat.

Other Commands

There are many other commands you can use when linking to a PDF file. These are taken from the Adobe Acrobat help file. Just add them after your document filename followed by a pound sign (#). If you would like to execute more than one command in a single link, seperate them with an amperstand (&) like this:

<a href="mydoc.pdf#pagemode=bookmarks&page=5">

This will open mydoc.pdf to page 5 and display the bookmarks tab.

Here is a table of commands that Adobe Acrobat recognizes:

Description Command Comments
Go to a page page=page_number The page number must be an integer. A PDF file’s first page has a page number of 1.
Go to a destination nameddest=destination_string  
Zoom or scroll a page zoom=scale[, left, top] All values must be integers or in floating-point notation. A scale of 100 gives 100% zoom. Scroll values for left and top are user coordinates (0,0 is the top left of a visible page, regardless of page rotation).
Set the view of a page view=Fit
view=FitH[, top]
view=FitV[, left]
view=FitB
view=FitBH[, top]
view=FitBV[, left]
Fit, FitH, and so on are keywords defined in the Portable Document Format Reference Manual (www.adobe.com). Scroll values for left and top must be integers or in floating-point notation. These values are user coordinates (0,0 is the top left of a visible page, regardless of page rotation).
Set the location and size of the view rectangle viewrect=left, top, width,height All values must be integers or in floating-point notation. Scroll values for left and top are user coordinates (0,0 is the top left of a visible page, regardless of page rotation).
Display bookmarks or thumbnails pagemode=mode The possible values are bookmarks, thumbs, and none
Display the scrollbars scrollbar=boolean_value The possible values are true and false.
Display the tool bar toolbar=boolean_value The possible values are true and false.