[Libreoffice-bugs] [Bug 142707] New: PDF: Export to PDF of relative hyperlinks created by function HYPERLINK() not plausible

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jun 7 21:42:45 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=142707

            Bug ID: 142707
           Summary: PDF: Export to PDF of relative hyperlinks created by
                    function HYPERLINK() not plausible
           Product: LibreOffice
           Version: 7.1.2.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: scno at gmx.net

Description:
Relative paths to a subdir are not exported correct to a pdf. There happens a
lot of unwanted and untested string conversion I think.


Steps to Reproduce:
Export relative path in PDF export dialog.
Create directory "subdir" on "d:\".
Use a working pdf as target.
Copy the pdf to "D:\subdir\"
Rename it to "file.pdf"
Create a calc document in "D:\".

Now we want a relative path to the pdf in the subdir.

Case A:
=HYPERLINK("subdir/file.pdf")

Case B:
=HYPERLINK("./subdir/file.pdf")

Case C:
=HYPERLINK("d:/subdir/file.pdf")

Case D:
=HYPERLINK("file:///d:/subdir/file.pdf")


Actual Results:
Case A:
- working hyperlink in ODS
  * path is relative
  * leading to "subdir/file.pdf"
- not working hyperlink in PDF
  * path is relative
  * leading to "file:///D:/./subdir%2Ffile.pdf"
  * a "./" is inserted

Case B:
- working hyperlink in ODS
  * path is relative
  * leading to "./subdir/file.pdf"
- not working hyperlink in PDF
  * path is relative
  * leading to "file:///D:/./.%2Fsubdir%2Ffile.pdf"
  * an additional "./" is inserted

Case C:
- working hyperlink in ODS
  * path is absolute
  * leading to "d:/subdir/file.pdf"
- not working hyperlink in PDF
  * path is relative
  * leading to "file:///D:/./d:%2Fsubdir%2Ffile.pdf"
  * a "D:/./" is inserted
  * I moved subdir and the pdf to "T:\"
  * now leading to "file:///T:/./d:%2Fsubdir%2Ffile.pdf"

Case D:
- working hyperlink in ODS
  * path is absolute
  * leading to "file:///d:/subdir/file.pdf"
- working hyperlink in PDF
  * path is absolute
  * leading to "file:///d:/subdir/file.pdf"


Expected Results:
Case A and B should in any case lead to working relative path.

Case C and D should in any case lead to working absolute path.



Reproducible: Always


User Profile Reset: No



Additional Info:
I used a workaround by computing the actual path.

=HYPERLINK(CONCATENATE(REGEX(CELL("FILENAME");"file:///.+/");"subdir/file.pdf"))

So I get a relative path to the pdf in both the ODS and in the exported PDF
file.

One small flaw in my workaround is because there is no celltext given in this
example, it does change the linkaddress in the exported PDF, if I copy it to a
new location, but not the celltext.

A bigger problem for Mac users may be, that it does not work on a Mac, but I
don't have a Mac for daily use to play around with.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210607/f3d81de7/attachment.htm>


More information about the Libreoffice-bugs mailing list