[Solved] Relative link to file?

Discuss the word processor
Post Reply
User avatar
Agilar
Posts: 85
Joined: Mon Oct 04, 2010 6:51 pm

[Solved] Relative link to file?

Post 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?
Last edited by Agilar on Wed Jun 20, 2012 12:03 pm, edited 1 time in total.
LibreOffice 4.1.2.3 on Kubuntu 14.04
User avatar
RoryOF
Moderator
Posts: 35064
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Relative link to file?

Post 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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
User avatar
Agilar
Posts: 85
Joined: Mon Oct 04, 2010 6:51 pm

Re: Relative link to file?

Post 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.
LibreOffice 4.1.2.3 on Kubuntu 14.04
User avatar
Agilar
Posts: 85
Joined: Mon Oct 04, 2010 6:51 pm

Re: Relative link to file?

Post 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.
LibreOffice 4.1.2.3 on Kubuntu 14.04
Post Reply