Created attachment 191550 [details] The example file saved as docx attachment 191548 [details] is an RTF file with only a formatted paragraph and drawing shape (line) in the header. Word hides this, but in Writer it's enabled, changing document layout. Also happens if the document is converted to docx format. 1. Open attachment 191548 [details] or the attached docx version -> page header is enabled, showing a line and a lot of spacing between the top of the page and the document body. Screenshot is attachment 191549 [details] Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 2eb428a8890dda29fbdc8b639fc1377080fab59f CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: hu-HU (hu_HU); UI: en-US Calc: threaded This seems to have started in 5.0 (for both docx/rtf), before it was good for both RTF/DOCX. Still good in doc: there the header is not enabled. https://cgit.freedesktop.org/libreoffice/core/commit/?id=17e51f427b3f0cec74ac8e0a1b3f51189006ae6f author Miklos Vajna <vmiklos@collabora.co.uk> 2014-11-21 17:41:24 +0100 committer Miklos Vajna <vmiklos@collabora.co.uk> 2014-11-21 18:10:59 +0100 commit 17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (patch) DOCX import: first page header should always set default headers as well
Created attachment 191551 [details] The docx example file in Word 2016 and Writer
Created attachment 191552 [details] Same example in doc format, this is / was always good
Confirmed for both DOCX and RTF in recent trunk build: Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 56767830b81fa21382b87cf43d78b1c73ca5dbd8 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded Online Office 365 has no such spacing and line at the top. But doesn't it make sense that LO shows the header if it has contents? Export the DOCX to PDF with Office 365 and you get two lines and spacing in both header and footer. I think LO is doing better as a WYSIWYG than MS Office here, so my take is "not a bug". Miklos, what do you think?
Created attachment 191768 [details] DOCX exported to PDF by Office 365
(In reply to Stéphane Guillou (stragu) from comment #4) > Created attachment 191768 [details] > DOCX exported to PDF by Office 365 Sorry, I need to clarify: this is the export _after_ expanding the header in the DOCX (but without editing it). If the document is exported without expanding the header, there are no lines and no extra space. Still feels like a MS Office bug to me.
I think the useful reference for desktop Writer's Word format handling is desktop Word. Seeing that our render differs in attachment 191551 [details] , I would tend to say it's useful to fix our side to match. And it's indeed annoying that sometimes Office Online 365 itself differs from desktop Word, but that's their problem. :-)
(In reply to Stéphane Guillou (stragu) from comment #3) > But doesn't it make sense that LO shows the header if it has contents? No, because MS is cheating all over the place (not rendering what's written into the XML or even into OOXML standard), and if we don't copy such cheats, documents will fall apart and the user experience will be: "LO sucks". Setting New per comment #6.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d918beda2ab42668014b0dd42996b6ccc97e8c3a tdf#158814 DOCX import: fix unwanted header with type="first" & no titlePg It will be available in 24.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.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/af302ee34f74b4d71b1721d23f62225b7e66ff2e tdf#158814 DOCX import: fix unwanted header with type="first" & no titlePg It will be available in 24.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.