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

            Bug ID: 170014
           Summary: Hyperlink clickable area is incorrectly positioned in
                    PDF output
           Product: LibreOffice
           Version: 26.2.0.0 alpha0+ master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Printing and PDF export
          Assignee: [email protected]
          Reporter: [email protected]

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())),
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to