A link between .odt files is lost when exporting to pdf book

I have an .odm master file containing 2 .odt files chapter1.odt and chapter2.odt. In first chapter1.odt file I create an hyperlink to a word located in the second chapter2.odt file. After exporting the book to pdf format, the link does not work anymore.
Reading the pdf with adobe reader and clicking on the link pops up a window saying it is trying to link to the source file chpater2.odt instead of jumping to the right section inside the generated pdf.

I think that you should use cross-references, not hyperlinks.

I do I make a cross référence to a different .odt file?

The Writer Guide has a chapter on master documents, within that are several pages on cross references. Download from English documentation | LibreOffice Documentation - LibreOffice User Guides

In summary, when a book is exported as pdf, it is possible from the table of content to jump to a heading located inside a different odt file but from one odt file it is impossible to jump to a location in a different odt file. Very strange that developers solved the problem for the table of content but not for the cross referencing between odt files!

When complaining about difficulties with LO, it is important to name both the OS and LO version.

Also you didn’t tell exactly kind of “data” you want to reference into the other file: heading, numbered paragraph or some specific location.

My answer is given for the generic case of a marked location.

You must be aware that marked locations are visible only if the destination is “included” in the file. This means that that master document “sees” everything in the sub-documents but a sub-document can “see” only its own contents, but the most important thing is to insert the “code” for the cross-reference.

  • in the target document, i.e. chapter2.odt
    1. select the target word
    2. Insert>Cross-reference, Cross-references tab
    3. Type Set Reference
    4. Name: give it a name unique across the whole collection of document, like ch2-xyz, i.e. with a prefix specific for this chapter, so that there is no ambiguity from the master document
  • in the origin document, i.e. chapter1.odt, where you want the “link”
    1. Insert>Cross-reference, Cross-references tab
    2. Type Insert Reference
    3. Name: type here the exact name you defined in the target document
      This is the way to bypass Writer checks; you force the reference even when Writer doesn’t see it
    4. Refer using: according to your need

Writer will of course complain in chapter1.odt with “Reference source not found”. Just ignore it. When you assemble the master, the replacement will be done because the master has access to all reference dictionaries.

The same solution is given here.

Hi,
Thank you for your time on this topic.
My OS is windows 8.1
I follow your steps:
in chapitre2.odt file, I type the text BOOO.
Then I select it and click on Cross-reference ->set Reference
In the Name I enter jumptoBOOO and click Insert button.
Now, I go back to chapitre1.odt file and select the text gotoBOOO and from the menu
Cross-references->insert Reference, after selecting from “refer using”-> referenced text
in the name field I enter jumptoBOOO and click Insert button. I close the window.
I then go tback to the master .odm file and from the menu Tools->update all.
Then I from the menu in the odm file I select File->Export pdf and generate the resulting pdf file.
After opening the resulting file with adobe reader version 7 if I click on the text BOOO, it works!
Thank you very much.

1 Like