Bug 170014 - Hyperlink clickable area is incorrectly positioned in PDF output
Summary: Hyperlink clickable area is incorrectly positioned in PDF output
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-17 04:31 UTC by shinbird
Modified: 2026-01-01 03:13 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample ODS file to reproduce the issue (8.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-12-17 04:37 UTC, shinbird
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shinbird 2025-12-17 04:31:48 UTC
Description:
When exporting a Calc or Excel document to PDF using the command-line option `--convert-to pdf`, the clickable area of hyperlinks is not positioned correctly. As a result, clicking on the hyperlink text in the PDF does not activate the link.

Steps to Reproduce:
1. Prepare a Calc or Excel file that contains one or more cells with hyperlinks.
2. Export it using: `soffice --headless --convert-to pdf filename.xlsx`
3. Open the generated PDF.

Actual Results:
The hyperlink clickable area is incorrectly positioned and does not align with the hyperlink text. In some cases, it appears to be located at the page origin (0,0).

Expected Results:
The clickable area of the hyperlink should be aligned with the visible hyperlink text in the PDF output.


Reproducible: Always


User Profile Reset: No

Additional Info:
The issue appears to be caused by a missing transformation applied to the hyperlink clickable view range during PDF export.
The calculated view range is not transformed using the current transformation matrix, which results in the clickable area being placed at an incorrect position.
Applying the current transformation to the hyperlink view range resolves the issue.
A minimal fix is shown below:

```
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 7d45071f6702..bce4c357e97a 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1427,7 +1427,8 @@ void VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(
         return;
 
     // emulate data handling from ImpEditEngine::Paint
-    const basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+    basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+    aViewRange.transform(maCurrentTransformation);
     const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aViewRange.getMinX())),
                                       static_cast<sal_Int32>(floor(aViewRange.getMinY())),
                                       static_cast<sal_Int32>(ceil(aViewRange.getMaxX())),
```
Comment 1 shinbird 2025-12-17 04:37:48 UTC
Created attachment 204688 [details]
Sample ODS file to reproduce the issue

This file demonstrates the issue where the hyperlink clickable area is incorrectly positioned when using '--convert-to pdf'.