Page 1 of 1

[Solved] Relative link to file?

Posted: Wed Jun 20, 2012 11:25 am
by Agilar
Is there a way I can make a hyperlink of relative path to file?

I have a folder with my odt and a pdf file there. I want to make a relative link to the pdf file - to insert the link in odt.

How can this be done?

Re: Relative link to file?

Posted: Wed Jun 20, 2012 11:28 am
by RoryOF
From
http://www.owlfish.com/software/PubTal/ ... ffice.html
Links

To use a URL to link to another document on the same website (a relative link), the OpenOffice "Document" hyperlink option must be used, not the "Internet" option. This is because OpenOffice treats all links entered using the "Internet" panel of the Hyperlink dialog as being absolute addresses (fine for external links). To check that the correct type of link has been created, enable the Hyperlink Bar using "View -> Toolbars -> Hyperlink Bar". If the hyperlink you have entered begins with "file://" then it is a relative link, otherwise it is an absolute link.

Re: Relative link to file?

Posted: Wed Jun 20, 2012 11:36 am
by Agilar
So I have:

Code: Select all

.
├── 124.pdf
└── 2.odt
If I insert

Code: Select all

file://abspath
in the "Document" field - the link works. If I do:

Code: Select all

124.pdf
or

Code: Select all

file://./123.pdf
if doesn't.

Re: Relative link to file?

Posted: Wed Jun 20, 2012 12:03 pm
by Agilar
Oh - I solved it!

Two things:
  • Options -> Load/Save -> General check the relative links
    When making hyperlink - choose the Document not the Internet
This way despite it shows the absolute path - the link is relative.