Insert link like '/home/test' but after save become to ../../../home/test

Hello everyone, I have encountered an issue. When I insert a hyperlink in LibreOffice 7.2, for example, /home/test, after inserting and saving, when I try to export it to PDF, the link becomes …/…/…/home/test. My understanding is that LibreOffice automatically adds the relative path of the current file, but I just want to keep the original path. What should I do in this case?

PS: I don’t have this issue when exporting with Word.
Thank you, everyone.
Sorry, as a new user, I can only upload one image at a time. I will provide more information in subsequent comments
jump.docx (9.3 KB)

When I finish editing with LibreOffice and open it with Word, the corresponding path changes. However, there is no issue when I directly edit with Word and use the path /home/test.

Export with Word

Because we use a document conversion service to convert various office document types, such as docx, excel, pptx, etc., into PDFs and provide online services website, users may employ relative paths compared to our online reading service website as some hyperlink destinations. This may result in data like “/home/test” appearing in docx files. After converting to PDF, we want links of this type to remain unchanged, allowing users to navigate properly when viewing online.

need help…

You didn’t tell how you export to PDF. There are three menu commands:

  • File>Export
  • File>Export As>`Export as PDF``
  • File>Export As>Export directly as PDF

The latter one is a shortcut which uses some default settings (or the last settings used). No export configuration dialog appears.

The first two commands are equivalent and trigger an export configuration dialog. In Links tab, you can choose how paths are exported into the PDF. Untick Export URLs relative to file system for absolute path.

This default was chosen to facilitate export of entire directories on removable media and installation on other computers without the need to fix paths on the destination computers.

Remarks:

  1. If you’re the creator of the file and intend to edit it with Writer, save as .odt to prevent progressive corruption of the document by iterative conversions to/from alien format.
  2. There is no point in insisting to get help. Your question is recorded in AskLO database. It only shows you’re impatient and have not understood this site is manned benevolently by other users just like you. These users don’t live in the same time zone as you. You must accept to wait that the shines over our heads before we can answer. Don’t be rude. All the more that answer to your question can be found in the documentation. Have you read the Writer Guide?
1 Like

Hello, thank you for your response and answers. Currently, I export to PDF in two ways. The first method involves clicking on “Export As_Export directly as PDF” in the editing toolbar, which is what you mentioned as “Export As_Export directly as PDF.” In this case, I only see options for displaying the file name and path; there are no other options related to the path.

The second method involves using Java code with the org.jodconverter.core.DocumentConverter object to invoke the PDF conversion functionality provided by the LibreOffice service. Currently, both methods are encountering the same issue.

Also, I appreciate your reminder about the way questions should be asked. I am indeed a new user and not very familiar with the rules for asking questions here. Adding supplementary information and responding are attempts to prevent the post from sinking.

Thank you for taking the time to answer my questions. I will follow your guidance and explore the documentation regarding this issue.

I tried as you suggested, and after unchecking ‘Export URLs relative to file system for absolute path,’ the current URL now automatically adds the ‘file://’ prefix. Unfortunately, this still doesn’t provide the data I need.

I would like the data to remain the same as my original, without any modifications or additional prefixes.

sorry, I have reached the maximum number of replies.
here is the reason:
Because we use a document conversion service to convert various office document types, such as docx, excel, pptx, etc., into PDFs and provide online services, users may employ relative paths compared to our online reading service website as some hyperlink destinations. This may result in data like “/home/test” appearing in docx files. After converting to PDF, we want links of this type to remain unchanged, allowing users to navigate properly when viewing online.

Then explain your purpose (related to what you do with the PDF). You presented your “solution” to your goal without describing it. Since we have more experience with Writer, we might suggest an alternative lead.

1 Like