Bug 163194 - PDF export with comments in margins should adapt their width to the width of comment area (DisplayWidthFactor)
Summary: PDF export with comments in margins should adapt their width to the width of ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.8.0 target:26.2.1
Keywords:
: 166160 (view as bug list)
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2024-09-28 15:32 UTC by Jérôme Borme
Modified: 2026-02-27 08:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example odt document (15.81 KB, application/vnd.oasis.opendocument.text)
2024-09-28 15:33 UTC, Jérôme Borme
Details
Example of the resulting exported PDF (45.00 KB, application/pdf)
2024-09-28 15:33 UTC, Jérôme Borme
Details
PDF export comment in margin Width (24.2.7.2 vs. 26.2.1.2) (102.50 KB, image/gif)
2026-02-27 08:08 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme Borme 2024-09-28 15:32:33 UTC
Description:
When the user sets a wider comment area (new feature) then exports the document as PDF by exporting the comments in margins, the comments don't fit into the PDF page are truncated to the right.

Steps to Reproduce:
1. Create a Writer document, add a lengthy comment
2. Change the width of the comment area. Due to Bug 162937, I did not use the UI, I changed the comment width in registrymodifications.xcu by setting DisplayWidthFactor to 4
3. Export as PDF and check "Comments in margin"


Actual Results:
The comments are truncated

Expected Results:
The whole document should have been scaled down to fit into the printable area, considering the larger width of comment area.


Reproducible: Always


User Profile Reset: No

Additional Info:
See attached example
Comment 1 Jérôme Borme 2024-09-28 15:33:00 UTC
Created attachment 196767 [details]
Example odt document
Comment 2 Jérôme Borme 2024-09-28 15:33:20 UTC
Created attachment 196768 [details]
Example of the resulting exported PDF
Comment 3 BogdanB 2024-09-28 17:53:36 UTC
Confirm with
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 4 Mike Kaganski 2026-01-31 16:25:42 UTC
(In reply to Jérôme Borme from comment #0)
> Expected Results:
> The whole document should have been scaled down to fit into the printable
> area, considering the larger width of comment area.

https://gerrit.libreoffice.org/c/core/+/198457 implements a different strategy. It keeps the "comments in margins" the same width as before introduction of the DisplayWidthFactor (and fixes its longstanding problem of DPI dependency). Allowing the original page to scale down infinitely, to allow any possible value of DisplayWidthFactor, is unreasonable, and may easily make the page scaled down to, say, 1/10 of its original size. Note that this also means scaling down of the comment text; so making comments wider will make the result unreadable as a whole.

So: printing / exporting to PDF will restore to producing comments that fit into the page area after the original page was scaled down by 0.75, independent of the DisplayWidthFactor value.
Comment 5 Commit Notification 2026-01-31 18:10:27 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fb52efb4aecaf5034c2ef84c185e3d7a6ca8c416

tdf#163194: Make width of comments in margin fixed on print / PDF export

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2026-02-01 03:24:17 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/cf586fe3037097aa4bfef27021248205b9ddee6c

tdf#163194: Make width of comments in margin fixed on print / PDF export

It will be available in 26.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 BogdanB 2026-02-01 11:16:17 UTC
Nice, thanks Mike.

Good in
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: d4c50dd103ca97ae2b767afdafe50fd1e3521b48
CPU threads: 16; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Bad in (for comparison reason)
Version: 26.2.0.2 (X86_64)
Build ID: 750d5fef117734aeeb00d37a069d6c814e9eb8ce
CPU threads: 16; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 8 Mike Kaganski 2026-02-24 05:44:19 UTC
*** Bug 166160 has been marked as a duplicate of this bug. ***
Comment 9 Piotr Osada 2026-02-27 08:08:16 UTC
Created attachment 205832 [details]
PDF export comment in margin Width (24.2.7.2 vs. 26.2.1.2)

Verified.

1000 ms animated GIF comparison betwen:

Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 16; OS: Windows 10.0 Build 26200; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

and

Version: 26.2.1.2 (X86_64)
Build ID: 620(Build:2)
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-US (pl_PL); UI: en-US
Calc: CL threaded