Understanding the PDF file Format – Named locations

The PDF file format allows you to specify Destination which you can goto by clicking a link or upon certain actions. There locations can even be in other PDF files. As an example, you might have

[12 0 R /Fit]

which takes you to the Page object described by Object 12 0 R and FitsToPage. Pretty neat but a bit cryptic. So you can create an additional structure (a Name tree) which allows you to refer to the page by a label (defined in the Name tree) rather than the object. So you could have TitlePage instead of 12 0 R and the PDf file would lookup title page in the Name tree (and find 12 0 R).

Name trees make the PDF structure more understandable and also easier to maintain and change. Are you using them?

This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!

Related Posts:

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.
Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>