What is a Fragment Identifier?
Fragment Identifier is a feature defined in Annex O of ISO 32000-2 that allows precise content anchoring and display control within linked PDF files using URLs. These identifiers follow the # symbol in a URL and control what content is shown.
For example, you can open a specific PDF page by adding #page=n (where n starts from 1) to the URL: https://www.pdfa.org/wp-content/uploads/2013/05/PDFA_in_a_Nutshell_211.pdf#page=5 opens the 5th page of the PDF.
Parameters a PDF URL can use
The fragment is the part of a URL after the hash sign, and for a PDF it is handled by the viewer instead of the server. Common parameters are:
- page, which opens the document at a specific page, counting from one.
- nameddest, which jumps to a named destination defined in the document.
- zoom, which sets the magnification and optionally the scroll position.
- search, which opens the file with a term already searched for.
- toolbar, navpanes and statusbar, which show or hide parts of the viewer interface.
Several can be combined, separated by ampersands, for example in a link that opens page four at a fixed zoom.
Why a link sometimes opens on page one
Support is a viewer feature, not a file feature, and it is inconsistent. The parameters originate with Adobe Acrobat; browsers implement only some of them in their built-in viewers, and a browser that downloads the file instead of displaying it will ignore the fragment entirely.
The page parameter counts from one, unlike the integer page index used inside the file, and a named destination is the more robust choice because it still works if pages are inserted or removed.