Named destinations in PDF

Navigation:  Basic Working Procedures > Links, Anchors, Macros, Scripts and HTML >

Named destinations in PDF

Previous pageReturn to chapter overviewNext page

Show/Hide Hidden Text

When Help & Manual generates PDF documents it automatically exports a number of targetable items as standard PDF "named destinations". These destinations are a little like topic anchors in HTML documents – they can be used as jump targets from other applications and other PDF documents.

 

flag_green        Key Information

Named destinations are for links between PDF files and for links to PDFs from other applications. Named destinations are only generated if you generate an interactive PDF document.

Click to expand/collapseItems exported as named destinations

Both topic IDs and page numbers are exported as named destinations. The topic IDs are exported exactly as they are entered in Help & Manual, with the upper and lower case unchanged – if your topic ID is IndexTopicOne then that is also the named destination in the PDF. Page numbers are exported as Arabic numerals and the pages are numbered consecutively, starting with 1 on the very first page of the document, even if that is the cover.  There are no section numbers. (This is also the way that Adobe Reader numbers PDF documents.)

Note that it is possible for topic ID destinations to be duplicates, for example if a topic has the same name as a section or if you use multiple projects that contain a topic with the same name. This doesn't affect the internal linking between topics, because that is based on unique hash numbers, but  you should take this into account for your external references.

Anchors inserted in your topics are exported together with the topic IDs using the syntax TopicID#AnchorID – i.e. the topic ID is always part of the named destination for an anchor, with a pound character (#) between the two.

The following named destinations are exported for the standard PDF template sections defined in your print manual template. These destinations are exported in all capital letters. (The commas are not part of the destinations.)

COVER, TITLE1, TITLE2, TITLE3, FOREWORD, TOC, TOPICS, ENDNOTE1, INDEX, ENDNOTE2, BACKCOVER

Note that there are no destinations for repeating sections like Top Level Entry and Blank Pages.

User-defined PDF sections created in Manual Designer with the Insert Page option in the Pages menu are also exported as named destinations. The destinations generated for these sections are called CUSTOM1, CUSTOM2, CUSTOM3 and so on.

Important note:
The named destinations are fixed and are assigned in the order in which the user-defined sections are created. The first section you create gets the destination CUSTOM1, the second section gets CUSTOM2 and so on. The actual order of the custom sections in your template is irrelevant. We know that this is sub-optimal and we plan to improve it in a later update.

Click to expand/collapseLinking to named destinations between PDF documents

You don't need to use named destinations for links within your PDF projects. You can use normal topic links for those and they will work in PDFs in the same way as in other help formats, provided you have activated the options for creating an interactive PDF. You only need to use named destinations if you are creating links between PDF files or to a PDF from an HTML page (see below) or another application.

Named destinations are supported with interactive PDFs only:

If the PDF you are linking to is created with Help & Manual it must be generated using the "interactive PDF" option in your PDF settings. Named destinations are only generated for interactive PDF documents.

Current restrictions on PDF-to-PDF links

The PDF engine used in Help & Manual currently has some restrictions on exporting links to page numbers and named destinations to PDF documents. At the moment you can only create links to page numbers, not to named destinations. Also, links to page numbers will jump two pages ahead of the specified number (see below).

These restrictions do not apply if you are adding links to a PDF in Acrobat or another PDF editing application. You can link to both named destinations and page numbers and the page number links will link to the correct number.

Links created in Help & Manual:

To link from a PDF created in Help & Manual you need to create a file link with the page number added to it. This number must the number you want to link to minus 2! For example, if you want to link to page 7, you must specify page 5.

1.Follow the instructions for inserting a file link and enter the name of the PDF file you want to link to.

2.Add a # character and the page number to the end of the file name minus 2, like this:

myfile.pdf#123 (jumps to page 121)
myfile.pdf#0 (jumps to page 2)
myfile.pdf#12 (jumps to page 10)

To link to page 1, just link to the PDF document without any page number.

Links created in Adobe Acrobat or another PDF tool:

If you are using Adobe Acrobat or another PDF editing tool you can add links to PDFs to jump to named destinations and page numbers in PDFs created by Help & Manual.  You can enter the exact page number you want to jump to. Then myfile.pdf#123 will really jump to page 123. For instructions, see the  documentation of your PDF editing tool.

At the moment you can't create PDF links to named destinations in another PDF in Help & Manual itself, the links won't work and will only jump to the first or second page of the PDF document. Sorry about that – this will be improved in a later release of Help & Manual.

However, if you are using Adobe Acrobat or another PDF editing tool you can add links to other PDFs to jump to named destinations and page numbers in PDFs created by Help & Manual. For instructions, see the documentation of your PDF editing tool.

Click to expand/collapseHTML links to specific pages and named destinations in a PDF

Support and restrictions of HTML links to PDF:

You can link to specific pages and named destinations in PDFs generated by Help & Manual from both H&M WebHelp help documents and other HTML pages. However, links to page numbers and named destinations in PDFs do not work in CHM (HTML Help) files. This appears to be a restriction of the Microsoft CHM viewer.

You can create Internet links to PDF files that target a specific page in the PDF. This will work with PDFs created with Help & Manual and with most other PDFs, although you should always test it first because it does not work universally.

1.If the PDF you are linking to is created with Help & Manual it must be generated using the "interactive PDF" option in your PDF settings.

2.Create an Internet link to the PDF file you want to open, using the normal URL syntax for Internet links.

3.Add #page=x directly after the PDF filename, where "x" is the page number you want to jump to.

Important note:
When referenced from HTML links, PDF files are numbered consecutively, starting with 1 on the first page, even if this is the cover page.

Examples:

http://www.helpandmanual.com/PDF/myfile.pdf#page=264 (absolute link to a PDF)

myfile.pdf#page=264 (relative link to a PDF in the current folder)

../myfile.pdf#page=264 (relative link to a PDF in the folder above the current folder)

Help & Manual automatically generates a number of named destinations in your PDF files,which can be used as link targets in the same way as anchors. You don't need to use named destinations for normal topic links topics inside a project, those work in PDFs without any action on your part. However, named destinations are useful if you want to link to a specific location in a PDF from a HTML page, another PDF file or an application.

See Named destinations in PDF for full details on the available named destinations you can use.

1.If the PDF you are linking to is created with Help & Manual it must be generated using the "interactive PDF" option in your PDF settings.

2.Create an Internet link to the PDF file you want to open, using the normal URL syntax for Internet links.

3.Add #nameddest=destination directly after the PDF filename, where "destination" is the the named destination you want to jump to. This is case-sensitive, upper and lower case must match the actual destination exactly.

Note:
You can also use the abbreviated syntax #destination, which is supported by all current versions of Adobe Reader.

Examples:

http://www.helpandmanual.com/PDF/myfile.pdf#nameddest=TOC (links to the TOC section in an H&M PDF)

myfile.pdf#nameddest=TOPICS (links to the beginning of the topics section)

../myfile.pdf#Intro_Topic (links to the topic with the ID Intro_Topic, short syntax version)