When Writer tries to export to PDF (direct or not) a document with a hyperlink with an anchor ("#" beginning a URL fragment following a URL path or perhaps a query or parameters) the anchor marker character "#" (sharp, pound) is converted into three characters "%23", its URL encoding, losing the meaning of the anchor and probably making the entire URL invalid.
To recreate, put a URL with an anchor like http://www.jfsowa.com/ikl/#ikris into a document. Evoke Export As PDF. Attempt to follow the link in the PDF version.
Thank you for reporting the bug. I can not reproduce the bug in Version: 24.2.1.2 (X86_64) / LibreOffice Community Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 6a064b1967e06e40be40817deff99d00c1a8554f CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded I did both export directly as PDF and export as PDF and opened the PDF with Adobe Acrobat, the link worked fine and there was no conversion of # -> %23
When tried on MacOSX 10.15.7 with LibreOffice 24.2.1.2, the bug is still present. The sucessful tests were done with Windows 10.
Marking as duplicate of bug 146768, as it seems the be the same macOS-specific issue. *** This bug has been marked as a duplicate of bug 146768 ***