Bug 168679 - FILESAVE PDF Exporting comments to margin and annotation makes the annotations wrongly placed
Summary: FILESAVE PDF Exporting comments to margin and annotation makes the annotation...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
25.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2025-10-03 16:40 UTC by Gabor Kelemen (allotropia)
Modified: 2025-10-06 07:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer with annotations (44.83 KB, application/vnd.oasis.opendocument.text)
2025-10-03 16:40 UTC, Gabor Kelemen (allotropia)
Details
The example file exported with current nightly, with both comment export modes enabled (49.46 KB, application/pdf)
2025-10-03 16:44 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2025-10-03 16:40:24 UTC
Created attachment 203129 [details]
Example file from Writer with annotations

When a document contains comments and they are exported to PDF enabling both the "Comments as PDF annotations" and "Comments in margins" boxes (also: Why are these not mutually exclusive radio buttons? It looks weird UX having the same comment in two representations in the same PDF.), then the annotation markers are slipping vertically upwards from their expected position.

1. Open attached document
2. File - Export As - Export as PDF
3. Check both the "Comments as PDF annotations" and "Comments in margins" boxes, OK
4. Open the resulting PDF
-> The annotation markers are correctly placed on the first page, but significantly more to the top on the second and third.

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 708abf24664a9a1aaeac452bcc8436026030e74e
CPU threads: 14; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

The "Comments in margins" box appeared in 7.5, but did not yet produce two representations in PDF, only the margin one. This started in 25.2, with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1e905680c85c4b79cc72df5dcece38a65898a90d

author	Tibor Nagy <tibor.nagy.extern@allotropia.de>	2024-09-05 00:25:19 +0200
committer	Nagy Tibor <tibor.nagy.extern@allotropia.de>	2024-09-05 22:58:30 +0200
commit 1e905680c85c4b79cc72df5dcece38a65898a90d (patch)

tdf#162359 sw: fix the export of comments as PDF annotations
Comment 1 Gabor Kelemen (allotropia) 2025-10-03 16:43:28 UTC
Adding CC to: Tibor Nagy

That other change seems sensible. 
I can also imagine this can be solved (hidden?) by changing the UI to have the two options mutually exclusive on UX grounds. 
CC also ux-advise list.
Comment 2 Gabor Kelemen (allotropia) 2025-10-03 16:44:14 UTC
Created attachment 203131 [details]
The example file exported with current nightly, with both comment export modes enabled
Comment 3 Heiko Tietze 2025-10-06 07:59:07 UTC
(In reply to Gabor Kelemen (allotropia) from comment #0)
> (Why are these not mutually exclusive radio buttons?
In my tests on Linux, the first option "Comments as PDF annotations" adds the comments as such to the list of annotations. There are no annotations in the PDF if this option is unchecked. The second option "Comments in margin" either shows the comments as LibreOffice does or, if unchecked, per indicator in the PDF.

Regarding the bug I can confirm the issue. Even if comments are on the first only, there is a significant margin at the top of page.

Version: 25.8.1.1 (X86_64) / LibreOffice Community
Build ID: 580(Build:1)
CPU threads: 32; OS: Linux 6.16; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
25.8.1-3
Calc: threaded