Bug 166785 - Incorrect reference hyperlink behavior when exporting DOCX to PDF — references to bookmarks display internal clause IDs (e.g., "1.1(2)") instead of expected visible titles (e.g., "Schedule 4").
Summary: Incorrect reference hyperlink behavior when exporting DOCX to PDF — reference...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Export Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2025-05-29 20:45 UTC by Hwa Chuang
Modified: 2025-07-13 18:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document for reproduce issue (30.24 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-05-29 20:47 UTC, Hwa Chuang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hwa Chuang 2025-05-29 20:45:08 UTC
Description:
 When exporting the attached Word document (missingref1.docx) using LibreOffice, a cross-reference in the text is not preserved as expected. Specifically, the phrase on page 1 of the original Word document reads:

"...the Business specified in Schedule 4;"

However, after exporting to PDF using LibreOffice, this same line incorrectly appears as:

"...the Business specified in 1.1(2);"

Additionally, the LibreOffice UI (in editing view) also displays the reference as “1.1(2)” after the PDF export, suggesting the original cross-reference is being reinterpreted as a clause ID rather than the heading or title.

This behavior does not occur in Microsoft Word, which preserves the visible cross-reference text (“Schedule 4”) correctly in both the UI and exported PDF.


Steps to Reproduce:
1.Open missingref1.docx in LibreOffice.

2.Observe the text on page 1:
  "...the Business specified in Schedule 4;"

3.Export the file to PDF using File > Export As > Export as PDF....

4.Open the resulting PDF file.

5.Observe the changed text on page 1:
  "...the Business specified in 1.1(2);"

6.Return to LibreOffice Writer UI — the same text is now altered in the document itself.

Actual Results:
Both LibreOffice Writer UI and exported PDF have "...the Business specified in 1.1(2);"

Expected Results:
1.The cross-reference should remain as “Schedule 4” both in the LibreOffice UI and in the exported PDF.

2.The exported PDF should reflect the visible label of the referenced section (e.g., a heading or caption), not an internal clause or field code.


Reproducible: Always


User Profile Reset: No

Additional Info:
Found this issue from libreOffice 5.0.1.2 and also can be reproduce in 25.2.4.1.
Comment 1 Hwa Chuang 2025-05-29 20:47:34 UTC
Created attachment 201033 [details]
Document for reproduce issue
Comment 2 Jeremy Norvell 2025-05-31 20:50:06 UTC
Thank you for reporting the bug. I can confirm that the bug is present in both versions of LibreOffice listed below.

The behavior appears when following the prescribed steps. Changes to Export to PDF options do not remediate this.

Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 84da1f50ca8261129909901c2ff72adb9c67510a
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded