Bug 143806 - Writer opens DOCX with slightly higher text spacing
Summary: Writer opens DOCX with slightly higher text spacing
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL: https://preview.redd.it/c48pt7e9kig71...
Whiteboard:
Keywords: bibisected, filter:docx
Depends on: 105876
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-10 11:32 UTC by Meitar Bruner
Modified: 2021-08-27 07:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
docx file to export to PDF (42.97 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-08-10 15:18 UTC, Meitar Bruner
Details
PDF from DOCX with Word online (269.30 KB, application/pdf)
2021-08-11 20:42 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Meitar Bruner 2021-08-10 11:32:37 UTC
Description:
Hi!

Im using libre office to convert docx files to PDF.

1.When I export the 'docx' file from Microsoft Word everything works perfect.

2.When I export it via LibreOffice (7.06 and also 7.15 versions) sometimes titles are "jump" to the previous page.

You can see it in the image I've attached (Ive blured the data but you can see the problem).

Am I doing something wrong? This is a huge bug for my customers.

Will be more than happy for a solution!

Steps to Reproduce:
1.Create Word docx file with multiple pages when in page 2 above there is a title in the top of the page. 
2.Send to Libre PDF export

Actual Results:
Title "jump" to bottom of previous page

Expected Results:
The PDF layout should be the same as the docx file layout 


Reproducible: Always


User Profile Reset: No



Additional Info:
Export the PDF properly
Comment 2 Roman Kuznetsov 2021-08-10 14:54:04 UTC
Can you create an example as you wrote "1.Create Word docx file with multiple pages when in page 2 above there is a title in the top of the page." and attach it here?
Comment 3 Meitar Bruner 2021-08-10 15:18:53 UTC
Created attachment 174188 [details]
docx file to export to PDF

Hi, nice to speak with you,

1.I’ve attached a docx file.
2.The file has 3 pages.
3.When you export the file to PDF via LibreOffice, the title on the 3rd page marked with yellow (‘Appendix B – Ipsum lorem Ipsum Lorem Ipsum lorem’), is “jumping” to the bottom of 2nd page.

P.S: When you export it via Microsoft Word everything is fine.

I will be more than happy to solve this somehow.

Thanks,
Meitar Bruner
Fullstack Developer
Comment 4 QA Administrators 2021-08-11 03:59:50 UTC Comment hidden (obsolete)
Comment 5 Roman Kuznetsov 2021-08-11 10:10:21 UTC
The problem isn't in the exporting to PDF. LO opens your example wrong at once and it looks differently from MS Word

Confirm in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ac80ec817eb07c77a51bc0729985a473c734182e
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 6 Telesto 2021-08-11 20:41:14 UTC
Also in
4.4.7.2

and in

Versie: 4.1.0.4 
Build ID: 89ea49ddacd9aa532507cbf852f2bb22b1ace28

and in
Versie 4.0.0.3 (Bouw-id: 7545bee9c2a0782548772a21bc84a9dcc583b89)

looking ok with
LibreOffice 3.5.7.2 
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b
Comment 7 Telesto 2021-08-11 20:42:39 UTC
Created attachment 174217 [details]
PDF from DOCX with Word online
Comment 8 Meitar Bruner 2021-08-12 07:17:56 UTC
Sorry you are right. When I open the docx in LibreOffice GUI the title already jumping.

Do you know why this is happening? Can I prevent it somehow?
Unfortunately, can’t tell my customers to put page break.

A solution for this could really help!

Thanks, 
Meitar Bruner
Fullstack Developer
Comment 9 Meitar Bruner 2021-08-12 07:22:43 UTC Comment hidden (no-value)
Comment 10 Timur 2021-08-16 09:39:51 UTC
(In reply to Meitar Bruner from comment #0)
> This is a huge bug for my customers. Will be more than happy for a solution!

You may fix it yourself, pay it to be fixed (to your own or LO-certified devs) or just wait as long as it takes for a volunteer to pop in, days or decades. 
Everyone is welcome to submit a bug. But to those who urge it with "my customers need it" I think it's appropriate to advise a payment. 

After original wrong title, another wrong title is "Writer opens docx wrongly" because it should to pinpoint to the cause. Here it's a minor issue of height.

43all, commit 9eb3d13fd2ebe213dfdbd22cae8fe6c7f2998959
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=bd6310886dc4351a8ac3ed3ee9a4f65d2a0e005c..53f661b3140fe728fe3b8f421841dcb8e6f716ab
Comment 11 Justin L 2021-08-27 05:49:08 UTC
(In reply to Meitar Bruner from comment #8)
> Do you know why this is happening?
> A solution for this could really help!

1.) Do you have the Calibri font installed on your LibreOffice system? Obviously if all the fonts used aren't installed, then spacing can be different. (I too don't own Calibri, so I don't know if that would actually help, but this seems the most likely reason.)

2.) Normally the Heading styles have turned on the "keep with next paragraph" property, so that the document knows they should not be orphaned on a previous page. (That is much better than depending on "hitting enter to get the layout you want".)

3.) And of course the advice you didn't want is the best one. You NEVER start a new page by hitting Enter 20 times. (Why would you expect good results from bad document design?)
Comment 12 Justin L 2021-08-27 07:27:25 UTC
(In reply to Timur from comment #10)
> 43all, bibisect commit 9eb3d13fd2ebe213dfdbd22cae8fe6c7f2998959

I don't think this (or any bibisect) will be useful. There are too many factors that could be at play here.

I did a side-by-side comparison of PDFs to see where the space was different. The most glaring place is between "3. SubTitle" and the (unnecessarily) floating table (already in LO 3.5). Because nearly-full-width floating tables cause so much trouble, they are in-lined in LO. However, the .43cm horizontal distance from the paragraph seems to be thrown away. (I didn't find a duplicate bug report surprisingly.)

So in this case, it seems like we need to add .43cm (plus .21 from the previous paragraph itself so that they don't merge together) onto the top margin of the table. [But that would cause HUGE problems in case text had wrapped into that space.] 

Ultimately, this is depends on bug 105876.

However, even that said, the layout is still a few twips out - and the reported problem still remains.