Bug 155610 - On PDF export, extra spaces inserted between period and footnote anchor when viewed in Acrobat Reader
Summary: On PDF export, extra spaces inserted between period and footnote anchor when ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:24.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Footnote-Endnote PDF-Export
  Show dependency treegraph
 
Reported: 2023-05-31 13:13 UTC by Sarah
Modified: 2023-08-22 09:46 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample7423.pdf (2.23 MB, application/pdf)
2023-06-04 05:40 UTC, BogdanB
Details
Sample7532.pdf (2.28 MB, application/pdf)
2023-06-04 05:40 UTC, BogdanB
Details
Sample7423.odt (1.87 MB, application/vnd.oasis.opendocument.text)
2023-06-04 05:41 UTC, BogdanB
Details
Broker 7532.odt (1.86 MB, application/vnd.oasis.opendocument.text)
2023-06-04 05:41 UTC, BogdanB
Details
Screenshot showing Broken 7532 in Acrobat Reader (476.12 KB, image/png)
2023-08-10 17:08 UTC, Sarah
Details
Broken result from 24.2 (265.77 KB, application/pdf)
2023-08-21 16:13 UTC, Buovjaga
Details
Sitka Font Family installed by Windows 11 (504.98 KB, font/ttf)
2023-08-21 18:52 UTC, Sarah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sarah 2023-05-31 13:13:59 UTC
This problem is not present in v7.4.2. When an .odt file with footnotes is exported to PDF, extra spaces show up between the period of a footnoted sentence and the superscripted character that anchors the footnote.
Comment 1 BogdanB 2023-05-31 13:46:48 UTC
Sarah, can you attach a demo document?
Comment 2 BogdanB 2023-06-04 05:40:34 UTC
Created attachment 187711 [details]
Sample7423.pdf
Comment 3 BogdanB 2023-06-04 05:40:55 UTC
Created attachment 187712 [details]
Sample7532.pdf
Comment 4 BogdanB 2023-06-04 05:41:17 UTC
Created attachment 187713 [details]
Sample7423.odt
Comment 5 BogdanB 2023-06-04 05:41:35 UTC
Created attachment 187714 [details]
Broker 7532.odt
Comment 6 BogdanB 2023-06-04 05:41:54 UTC
These files and comment are from Sarah, received through email:
------------------------------------------------------------------
Attached are 4 files. Two are nearly identical files, created with different versions of Writer. The other two are the PDF exports of each. The older version performed a flawless PDF conversion, the newer one, not so much.
Comment 7 Buovjaga 2023-08-10 10:37:59 UTC
I don't see any extra spaces before the superscripts in the example PDFs or in my own test.

Sarah: can you attach a PDF that shows the problem?

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2d0268f5ae6061bc96c00481c9ef3547be300b5a
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 10 August 2023

Arch Linux 64-bit, X11
Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
7.5.5-1
Calc: CL threaded

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 218a7650a5cf03f895bed19c68d6f02daec536e9
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded
Comment 8 Sarah 2023-08-10 17:08:17 UTC
Created attachment 188914 [details]
Screenshot showing Broken 7532 in Acrobat Reader

The PDF I attached to my original report displays OK in a browser, I discovered, but not in Acrobat reader. I'm attaching a screenshot to show you how the file named "Broken 7532" looks when I open it in Acrobat Reader version 2023.003.20269 64 bit. I'll update to a newer version of Acrobat Reader and see if the problem goes away.
Comment 9 Buovjaga 2023-08-10 20:46:47 UTC
(In reply to Sarah from comment #8)
> Created attachment 188914 [details]
> Screenshot showing Broken 7532 in Acrobat Reader
> 
> The PDF I attached to my original report displays OK in a browser, I
> discovered, but not in Acrobat reader. I'm attaching a screenshot to show
> you how the file named "Broken 7532" looks when I open it in Acrobat Reader
> version 2023.003.20269 64 bit. I'll update to a newer version of Acrobat
> Reader and see if the problem goes away.

Ah, I can see them in Acrobat. I'll check more tomorrow.
Comment 10 Buovjaga 2023-08-17 12:02:16 UTC
Only seen when exported on Windows.
Bibisected with win64-7.5 repo to 164d717530aff8d2581d0a2ff249f83aabb27502
tdf#108497: instantiate variable fonts in PDF
Comment 11 ⁨خالد حسني⁩ 2023-08-21 15:51:56 UTC
Can someone try generating PDF with master branch?
Comment 12 Buovjaga 2023-08-21 16:13:39 UTC
Created attachment 189075 [details]
Broken result from 24.2

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e60ef8651cfb30335471d1622e58c13eebc7d58b
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded
Comment 13 ⁨خالد حسني⁩ 2023-08-21 16:28:22 UTC
I have no idea what is going on, and I’m tempted to call it an Adobe bug. For some reason it is using smaller advance width for the glyphs (you can see that text spacing is tighter in Acrobat) leading to accumulated difference and end of each text portion. I don’t know why it is doing that since every other PDF reader is rendering the text fine.
Comment 14 ⁨خالد حسني⁩ 2023-08-21 18:00:00 UTC
I can’t reproduce this with:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0d4feebac1a456744df9add3ed8b8655b5a56e72
CPU threads: 32; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

The version of Sitka that I have is not even a variable font, how did you get that variable version? I guess my Windows version is not up to date?

I can’t do much without the font, I tried many other variable fonts of various kinds and configurations and none behaves like this. I have a hypothesis on what might be triggering this (presumably) but in Adobe PDF implementation, but I need the fonts to check it.
Comment 15 Sarah 2023-08-21 18:52:43 UTC
Created attachment 189081 [details]
Sitka Font Family installed by Windows 11

Sitka Font Family installed by Windows 11
Comment 16 Commit Notification 2023-08-22 09:45:53 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

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

tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM

It will be available in 24.2.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.