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