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

Inserting file links

Print this Topic Previous pageReturn to chapter overviewNext page
Show/Hide Hidden Text

A file link is a link to an executable file (e.g. notepad.exe) or to a data file associated with an application  (e.g. DOC word processing files or PDF files). Clicking on the link in the help is just like double-clicking on an executable or DOC or PDF file on your desktop or in Windows Explorer. It either starts the executable file or opens the DOC, PDF or other file with the associated application.

File links are not supported in all output formats! See the compatibility list below for details.

How to insert file links

If you plan to publish to Microsoft HTML Help the files you link to must be stored in the same folder as the CHM help file. The Microsoft HTML Help viewer has a bug that makes it unable to access files outside the help file folder.

1.Select text in your document if you want to use it as the link. You can also skip this step and enter the caption in the hyperlink dialog.
2.Open the Insert Hyperlink dialog box. There are two ways to do this:
Press Ctrl+L
Select the Link tool in Write > Insert
3.Select the File Link tab:

4.Enter the filename with extension in the File Name: field.
5.Enter any execution parameters associated with the file in the Execution Parameters: field, for example the file to be opened by the executable file or any necessary parameters for a data file.
6.Click on Test to test the link (the file must be present in your project directory for this to work).

See The Hyperlink dialog for full details on the settings in the dialog.

Linking to page numbers and named destinations in PDF documents

Links between PDF files can open the PDF at a specific page number or named destinations inside the target PDF. However, linking to page numbers and named destinations only works in links between one PDF file and another. The same links in other formats will just open the PDF at the first page. This is a restriction of the PDF viewer, not of Help & Manual.

Linking to a specific page number:

File links from one PDF file to another PDF file can include a page number. The link will then open the PDF file and jump to the specified page. Note that the Adobe PDF format counts pages starting with "0" internally, so you must always enter one number higher than the page you actually want to jump to:

1.Follow the instructions for inserting a file link (see above) 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, like this:

myfile.pdf#123 (jumps to page 122)
myfile.pdf#0 (jumps to page 1)
myfile.pdf#11 (jumps to page 10)

That's all there is to it. Just remember that the number you enter must always be one higher than the page you want to jump to, because PDFs start counting at 0 internally. Internal section numbers are ignored – you can only jump to the absolute page numbers of the PDF document, which always start with 0 and continue sequentially through the entire document.

Linking to a named destination in PDF documents:

Some programs like Adobe FrameMaker support the creation of jump targets in PDF documents called "named destinations". You cannot enter named destinations in PDFs created with Help & Manual but you can use file links to link from one PDF file to a named destination in a PDF file created by a program like FrameMaker.

1.Follow the instructions for inserting a file link (see above) and enter the name of the PDF file you want to link to.
2.Add a # character and the named destination to the end of the file name, like this:

myfile.pdf#intro_section
myfile.pdf#details
myfile.pdf#advanced_users

Embedding linked files in PDF documents

You can automatically embed files referenced with file links into the PDF file when you export your project to PDF. This makes it possible to distribute additional files with your PDF document without having to use multiple files.

When the user clicks on the link the file will be displayed with the application with which it is associated in Windows. This works for most file types, including other PDF files, documents and images of all kinds and even executable EXE files.

1.In the Project Explorer go to Configuration > Publishing Options > Adobe PDF > PDF Layout and activate the option File links - embed linked files with the following extensions:.
2.Make sure that the files you want to link to are stored in one of the folders referenced in your Image Folders list in Project Properties. If you have many folder references place the files in one of the first few folders in the list.
3.Create your file links using the normal procedure.

When you compile your project the files referenced with file links will be physically embedded in the PDF file. You no longer need to distribute these files separately as they are now part of the PDF. This will increase the size of the PDF accordingly, of course.

File link compatibility in output formats

Winhelp:

Supported, both relative paths and execution parameters will generally work (exported as the ExecFile() macro).

HTML Help:

Supported with execution parameters but do not use paths. All external files must be in the same directory as the HTML Help CHM file.

Also, note that links to some types of external files in HTML Help are now restricted in Windows. This is a security feature implemented by Microsoft so you should test all links on properly-configured XP systems before distributing.

Even more severe restrictions apply to HTML Help files accessed across network drives. Here file links will not work at all and HTML Help itself is also severely restricted. See the EC Software website for more details. It is possible to enable the display of CHM files on networks but file links will not work in CHM files on network drives.

Webhelp:

Exported, but behavior depends entirely on the user's browser a file link in Webhelp is an URL to a file, with all that entails. Relative and absolute paths are supported; relative paths must be relative to the location of the help when it is accessed by the user. No execution parameters (for example, "wordpad.exe" on its own is OK but "wordpad.exe myfile.doc" will not work).

eBooks:

Supported, do not use paths, files must be in the same directory as the eBook. Simple file links only, no execution parameters.

Visual Studio Help:

Not supported. External file links are explicitly forbidden in Visual Studio Help / MS Help 2.0.

Adobe PDF:

Links to PDFs can include page number references (see above). Links from PDFs can be simple file links only, no execution parameters. Links must be activated in Configuration > Publishing Options > Adobe PDF > PDF Layout.

Word RTF:

Supported but not recommended – users are very likely to move Word RTF documents around and the links will then be dead. No execution parameters.

 


Page url: http://www.helpandmanual.com/help/index.html?hm_working_links_file.htm