Closes #6518 # Cause of the bug This is a fix to the #6518 issue. The bug happened because the link toolbar was rendered inside the PDF page layer. That layer can be affected by the viewer/page rotation transform, so the toolbar was laid out using local page coordinates and then visually transformed together with the page. As a result, the placement logic could calculate a position that was correct in the page’s local coordinate space, such as above or below the link, but the parent transform would rotate or shift that result after layout. On rotated pages, this could make the toolbar appear on the wrong side, inverted, or misaligned relative to the link. More specifically, in the PDF that exposed the bug, the page content appears to have been authored upside down and then corrected with a 180-degree page/viewer rotation so it looks normal to the user. Because the toolbar was rendered inside the same transformed page layer, it inherited that 180-degree rotation as well. The PDF content looked upright because the rotation was part of how the page was displayed, but the toolbar is viewer UI and should not be rotated with the page. As a result, the tooltip appeared upside down even though the PDF itself looked correct. # Description of Changes Fixes the inverted link tooltip/toolbar positioning in rotated PDF viewer pages. The link toolbar is now rendered through a body portal and positioned from the link element’s real viewport bounds, so page rotation transforms no longer flip or misalign it. The update also keeps the toolbar within the viewport during scroll, resize, zoom, and rotation changes, preserves the hover delay between the link and toolbar, centralizes the z-index in a shared constant, and improves label sizing to avoid clipped text. Note: The link hover styling was also changed from an underline to a subtle rectangular highlight based on the PDF link annotation bounds. <!-- Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --> --- ## Checklist ### General - [X] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [X] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [X] I have performed a self-review of my own code - [X] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [X] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) UI behaviour before the changes : <img width="1256" height="868" alt="Captura de tela de 2026-06-16 00-12-10" src="https://github.com/user-attachments/assets/321edbb3-42a2-4bc3-96ad-3ccc70a355b8" /> <img width="762" height="496" alt="Captura de tela de 2026-06-16 00-11-46" src="https://github.com/user-attachments/assets/be4c1af4-5488-4a54-9b6f-675e3bea73b8" /> <img width="1256" height="868" alt="Captura de tela de 2026-06-16 00-12-57" src="https://github.com/user-attachments/assets/60f44cd5-c772-44a8-97c8-bde135764e53" /> UI behaviour after the changes : <img width="1256" height="868" alt="Captura de tela de 2026-06-16 00-22-02" src="https://github.com/user-attachments/assets/dda77bda-0780-4807-a70d-3bbc60683e5a" /> <img width="1256" height="868" alt="Captura de tela de 2026-06-16 00-23-07" src="https://github.com/user-attachments/assets/5745c37e-438a-4bbe-ba1e-c6f2098421de" /> <img width="1256" height="868" alt="Captura de tela de 2026-06-16 00-23-24" src="https://github.com/user-attachments/assets/85932541-4a6f-48e4-879f-41f34a6d79e6" /> ### Testing (if applicable) - [X] I have run `task check` to verify linters, typechecks, and tests pass - [X] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing) for more details. --------- Co-authored-by: James Brunton <[email protected]> Co-authored-by: Anthony Stirling <[email protected]>
Stirling PDF - The Open-Source PDF Platform
Stirling PDF is a powerful, open-source PDF editing platform. Run it as a personal desktop app, in the browser, or deploy it on your own servers with a private API. Edit, sign, redact, convert, and automate PDFs without sending documents to external services.
Key Capabilities
- Everywhere you work - Desktop client, browser UI, and self-hosted server with a private API.
- 50+ PDF tools - Edit, merge, split, sign, redact, convert, OCR, compress, and more.
- Automation & workflows - No-code pipelines direct in UI with APIs to process millions of PDFs.
- Enterprise‑grade - SSO, auditing, and flexible on‑prem deployments.
- Developer platform - REST APIs available for nearly all tools to integrate into your existing systems.
- Global UI - Interface available in 40+ languages.
For a full feature list, see the docs: https://docs.stirlingpdf.com
Quick Start
docker run -p 8080:8080 docker.stirlingpdf.com/stirlingtools/stirling-pdf
Then open: http://localhost:8080
For full installation options (including desktop and Kubernetes), see our Documentation Guide.
Resources
Support
- Community Discord
- Bug Reports: Github issues
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project uses Task as a unified command runner for all build, dev, and test commands. Run task install to get started, or see the Developer Guide for full details.
For adding translations, see the Translation Guide.
License
Stirling PDF is open-core. See LICENSE for details.

