Bug 47838 - FORMATTING: Writer causes extra page-crossing (text flow to next page) in some MS Office documents - related with header/footer and page formatting.
Summary: FORMATTING: Writer causes extra page-crossing (text flow to next page) in som...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: All All
: high major
Assignee: Miklos Vajna
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: Writer-Header-Footer mab3.6
  Show dependency treegraph
 
Reported: 2012-03-25 04:24 UTC by Alexander
Modified: 2013-08-20 14:49 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
MS Word (97-2003,doc) document with simple text (no images, tables etc) (33.00 KB, application/msword)
2012-03-25 04:24 UTC, Alexander
Details
MS Word (97-2003,doc) document with simple text - version 2 (415.00 KB, application/msword)
2012-03-26 06:49 UTC, Alexander
Details
screenshot of first document, made in msOffice 2007 russian locale (348.91 KB, image/jpeg)
2012-04-05 06:14 UTC, sasha.libreoffice
Details
first document, saved to odt by msWord 2007. Opens correctly in Word and Writer (7.22 KB, application/vnd.oasis.opendocument.text)
2012-04-05 06:24 UTC, sasha.libreoffice
Details
Screenshot of 'test_writer_word.doc' with LibO 3.5.2.2 on MacOS X (178.67 KB, image/png)
2012-04-05 08:32 UTC, Roman Eisele
Details
Another screenshot with LibO 3.5.2.2 on MacOS X, showing BOTH pages (213.79 KB, image/png)
2012-04-05 11:50 UTC, Roman Eisele
Details
Screenshot of 'test_writer_word.doc' with msOffice 2010, showing the complete page (154.66 KB, image/png)
2012-04-07 02:35 UTC, Roman Eisele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander 2012-03-25 04:24:14 UTC
Created attachment 59002 [details]
MS Word (97-2003,doc) document with simple text (no images, tables etc)

Problem description: 
Writer places text on different page in comparison with MS Office Word. Very old bug. I think it stops many people from using Libre Office, because I have a lot of documents Writer opens with the same bug.

Steps to reproduce:
1. Open the attached document in MS Word (2003-2010 - any version shows completely the same formatting and places all text in one, single page).
2. Open the attached document in Writer - you'll see the last line is on the second page (there was no the second page in MS Word)! - in MS word it is on the first (single) page.

Current behavior:
Incorrect formatting - In MS Word there are one page, in Writer there are two pages

Expected behavior:
Displaying at least simple text documents without differences from MS Word

Platform (if different from the browser): Windows, Linux, FreeBSD - tried anywhere.
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Comment 1 Jean-Baptiste Faure 2012-03-26 05:05:26 UTC
Please check compatibility options: menu Tools > Options > LibreOffice Writer > Compatibility. If I check "Do not add leading (extra space) between lines of text", then the text needs only one page.

Best regards. JBF
Comment 2 Alexander 2012-03-26 06:49:01 UTC
Created attachment 59066 [details]
MS Word (97-2003,doc) document with simple text - version 2
Comment 3 Alexander 2012-03-26 07:02:38 UTC
(In reply to comment #1)
> Please check compatibility options: menu Tools > Options > LibreOffice Writer >
> Compatibility. If I check "Do not add leading (extra space) between lines of
> text", then the text needs only one page.
> 
> Best regards. JBF

It does not solves the problem. Please, check the attachment version 2.

If you check "Do not add leading (extra space) between lines of text" it will "compress" the text in bigger documents (like attachment version 2): the last page will contain only one paragraph. But in MS Word the last page contains three paragraphs.

The number of pages with default settings is incorrect. With checked option the position or size of text (paragraphs) is incorrect.

I think it's greatly inconvenient.

Regards,
Alexander
Comment 4 sasha.libreoffice 2012-04-05 06:14:39 UTC
Created attachment 59521 [details]
screenshot of first document, made in msOffice 2007 russian locale

Problems indeed exist, reproducible in 3.3.4 and 3.5.2.2 on Fedora 64 bit, in 3.5.1 on Windows 7. Text in Writer is approximately on 7% higher than in Word. 
In attachment rulers in centimetres.
We need edit each doc file before printing because this problem.
In Impress such problem also exist, font are bigger approximately on 7% than in mmPP. It breaks all layout.
Comment 5 sasha.libreoffice 2012-04-05 06:17:57 UTC
What is interesting, in Writer this document looks exactly on Linux as on Windows. Therefore problem is not in font installed.
Changing version to 3.3.4 as most early reproducible
Comment 6 sasha.libreoffice 2012-04-05 06:24:12 UTC
Created attachment 59522 [details]
first document, saved to odt by msWord 2007. Opens correctly in Word and Writer
Comment 7 Roman Eisele 2012-04-05 08:31:14 UTC
I understand this is a serious problem, but I have some difficulties to reproduce it. If I open the first sample document ('test_writer_word.doc') with LibreOffice 3.5.2.2 (Build-ID: 281b639-6baa1d3-ef66a77-d866f25-f36d45f), German langpack installed, running on MacOS X 10.6.8 German, it looks nearly identical to the MS Office screenshot attached in comment #2 -- I will attach my own screenshot.

Now, just in order to understand correctly: am I missing something? Is the problem you are talking about visible in my screenshot? Or is it not? If it is NOT visible on my screenshot, then the problem may be OS-dependend (I am using on LibreOffice on MacOS). Then it would be helpful if you could attach your own screenshot showing the same document but with the problem visible. (OR, if the problem is indeed visible on my screenshot, too, a more exact description would be necessary, as it is not obvious.)

No offence -- just wanting to help -- we need to make clear exactly what we are talking about and if the problem is OS-dependend etc. or not ...
Comment 8 Roman Eisele 2012-04-05 08:32:49 UTC
Created attachment 59524 [details]
Screenshot of 'test_writer_word.doc' with LibO 3.5.2.2 on MacOS X
Comment 9 Roman Eisele 2012-04-05 08:36:18 UTC
I forgot to mention: the option "Do not add leading (extra space) between lines of
text" (at Options > LibreOffice Writer > Compatibility) is NOT checked in my installation.
Comment 10 sasha.libreoffice 2012-04-05 08:48:35 UTC
Thanks for screenshot. Problem seen:
on my screenshot most bottom line is opposite to 8.5 cm on left ruler
on Your screenshot it is opposite to 9 cm
It is the same described difference on 5..7% in size, which annoying us
Comment 11 Alexander 2012-04-05 09:26:08 UTC
(In reply to comment #7)
Please look at the last line of the document (it is located at the bottom of the page) and compare its position in MS Word and Writer. Uploaded screenshots does not show the last line. But you can see that even on your screenshot document has 2 pages (Writer) and on the first screenshot from comment 6 in has one page (Word). Writer places text differently from Word.
In accordance with comment 3 it is not "compatibility options" problem.
Comment 12 Roman Eisele 2012-04-05 11:48:03 UTC
(In reply to comment #11)
> Please look at the last line of the document (it is located at the bottom of
> the page) and compare its position in MS Word and Writer. Uploaded screenshots
> does not show the last line. But you can see that even on your screenshot
> document has 2 pages (Writer) and on the first screenshot from comment 6 in has
> one page (Word). Writer places text differently from Word.

Oh no! How stupid by me! The two screenshots of the first paragraph seemed so seductively similar, that I completely forgot to check if there is some more text down the page ...

OK, now I understand completely. To make amends for my stupidity and to prevent others from the same error, I will attach another screenshot, this time showing BOTH pages and also the blank lines between the two paragraphs.

At least, we now know for certain that this is a real cross-platform bug, present both on Windows, Linux (see original report) and MacOS X (see my screenshots).
Comment 13 Roman Eisele 2012-04-05 11:50:08 UTC
Created attachment 59532 [details]
Another screenshot with LibO 3.5.2.2 on MacOS X, showing BOTH pages

This screenshot should expose the problem more clearly: it shows BOTH pages.
Comment 14 Jean-Baptiste Faure 2012-04-05 13:29:43 UTC
There is something which has a clear effect on the page layout of the second attachment (https://bugs.freedesktop.org/attachment.cgi?id=59066) :
1/ show non-printing characters
2/ select end-of-paragraph mark after the first paragraph until "last line 2012", then right click and clear direct formatting
3/ select the entire text by ctrl+A then format character > position tab > check "Pair kerning" > validate.

If you do that :
- last page has 3 paragraph like with MS-Word
- the third line (for example) is the same as in Abiword, it ends with "quia dolor sit amet," instead of "quia dolor sit".

Best regards. JBF
Comment 15 sasha.libreoffice 2012-04-06 03:06:00 UTC
What is interesting:
Open first attachment by Writer and save it as fodt file. Than open it in text editor and find and remove this:
style:master-page-name="First_20_Page"
Then save it and  open in Writer again. Page looks correctly.

PS:(I experimented also with unarchiving odt file, but Writer do not want to open it again when I zipped it manually and renamed to odt)
Comment 16 Alexander 2012-04-06 05:44:53 UTC
(In reply to comment #14)
> There is something which has a clear effect on the page layout of the second
> attachment (https://bugs.freedesktop.org/attachment.cgi?id=59066) :
> 1/ show non-printing characters
> 2/ select end-of-paragraph mark after the first paragraph until "last line
> 2012", then right click and clear direct formatting
> 3/ select the entire text by ctrl+A then format character > position tab >
> check "Pair kerning" > validate.
> 
> If you do that :
> - last page has 3 paragraph like with MS-Word
> - the third line (for example) is the same as in Abiword, it ends with "quia
> dolor sit amet," instead of "quia dolor sit".
> 
> Best regards. JBF

I also can edit the document in order to make it looks like in MS Word (even by another way).
The bug is that you need to edit the document (formatting, options, etc.). What if you do not have Word installed? How can you correctly print such documents?

Writer should display at least simple ".doc"-files like Word without re-formatting, without editing.

Regards,
Alexander
Comment 17 Jean-Baptiste Faure 2012-04-06 12:19:21 UTC
(In reply to comment #16)
> [...]
> Writer should display at least simple ".doc"-files like Word without
> re-formatting, without editing.

Of course, but what my tests show is that the problem may be in an error in the importer which may not set correctly the Pair kerning parameter.

Hi Miklos, could you have a look ? Please, feel free to reassign if you can't handle this bug.

Best regards. JBF
Comment 18 Roman Eisele 2012-04-07 02:32:59 UTC
(In reply to comment #17)
> Of course, but what my tests show is that the problem may be in an error in the
> importer which may not set correctly the Pair kerning parameter.
> 
> Hi Miklos, could you have a look ? Please, feel free to reassign if you can't
> handle this bug.

A good idea. But if I open the two DOC files with Word 2010, I get the impression that the (pair) kerning is deactivated everywhere; therefore, if LibreOffice Writer opens the DOC files with kerning deactivated, it does so correctly ...

Of course, this would mean that the problem is NOT caused by a wrong import of the Pair kerning parameter.
Comment 19 Roman Eisele 2012-04-07 02:35:02 UTC
Created attachment 59614 [details]
Screenshot of 'test_writer_word.doc' with msOffice 2010, showing the complete page

Just for the sake of completeness: a screenshof of 'test_writer_word.doc' with msOffice 2010, showing the complete (single) page
Comment 20 sasha.libreoffice 2012-04-07 03:04:18 UTC
Try copy-paste from msWord to Writer. It looks correctly. So suspicion that problem is in import filer is very serious.
Comment 21 Cor Nouws 2012-04-15 14:21:12 UTC
I noticed that both sample documents show a header and footer in Writer, but not in Word. It turns out to be the page-style problem: Writer picks up the header/footer info from the next pages in Word.
So this one of the many header/footer page formatting issues.

Maybe you can have a look in BugZilla to find the first issue for this problem, and add your info there, mark this one as a duplicate?
Comment 22 Cor Nouws 2012-04-15 14:27:34 UTC
removed as 3.5 MAB, added to the new container issue Bug 48741
Comment 23 Alexander 2012-06-03 02:04:35 UTC
When this bug will be fixed? New version 3.5.4 released, but the bug isn't fixed!
We are waiting for ages, the bug stops me and others from using LibreOffice!
Just look how people criticize compatibility of the LibreOfiice software.
Even "100% performance improvements" gives nothing useful if the program cannot work correctly!
Comment 24 sasha.libreoffice 2012-06-04 00:19:01 UTC
Sorry, but another more than 5000 bugs also waiting for fixing
Comment 25 Lekow 2012-08-29 16:48:30 UTC
The same issue is observed in LibreOffice 3.6.1.2. The document from attachment 59002 [details] looks exactly like on screenshot in attachment 59532 [details] . I have Windows 7 installed. 
It is really one of the most annoying bugs in LO!
Comment 26 Roman Eisele 2012-08-29 17:08:57 UTC
@ our writer experts:
Hello Cédric, Miklos, and Michael,
although I know that you have got to do many much more important things, and although in my personal opinion this is a minor bug (just a text reflow, no data lost), I have to agree to the idea that it is rather blameful if LibreOffice does not open even the simplest .doc file without formatting problems.

Therefore, it would be very nice if somebody could take a look at this issue and 


(In reply to comment #21)
> I noticed that both sample documents show a header and footer in Writer, but
> not in Word. It turns out to be the page-style problem: Writer picks up the
> header/footer info from the next pages in Word.
> So this one of the many header/footer page formatting issues.
> 
> Maybe you can have a look in BugZilla to find the first issue for this problem,
> and add your info there, mark this one as a duplicate?
Comment 27 Roman Eisele 2012-08-29 17:13:16 UTC
[Sorry, hit Enter by accident!]
...

Therefore, it would be very nice if somebody could take a look at this issue, maybe the reason of this problem is just some simple mistake here or there ...
(I completely understand that even in this case the problem is to find *where* exactly is that simple mistake, of course ;-)

In the comments to this bug report, you will find different theories about what exactly is wrong with LibreOffice’ handling of this document, but the most convincing idea so far seems Cor's suggestion (comment #21):

> I noticed that both sample documents show a header and footer in Writer, but
> not in Word. It turns out to be the page-style problem: Writer picks up the
> header/footer info from the next pages in Word.

If this is true, I hope that it should be possible to fix this "rather easily", like some other header/footer/page style problems which where fixed in the last months ...

Thank you very much!
Comment 28 Lekow 2012-08-29 17:52:39 UTC
@Roman, @Cor:
Thank you for the idea. 

I have found that on the first page it is needed to turn off footer and header. And (for long document example from attachment 59066 [details]) it is needed to turn off the header in other pages + to turn off AutoFit height for footer (I'm not sure isn't it a coincidence, but it helps)! Then both example documents are shown right.

Also I have tested my documents and I have found that Writer adds footers and headers for all page styles except of default. 

So, developers, please look at the footers and headers and AutofitHeight feature for imported documents.
Comment 29 V.K. 2012-09-06 23:12:13 UTC
So, I will try to conclude (thanks to previous comments):
1. Writer has the same behavior for all imported MS Office documents: footers and headers are wrong.
2. Footer (if not present in original document) is added for all page styles except of default. 
3. Header (if not present in original document) is added for all page styles except of default too. 
4. Autofit height should be turned off for both footer and header for imported documents to be shown as in MS Office.  (It is needed to check this tip. I tried for a lot of doc files. It works for me.)
Comment 30 Alexander 2012-12-09 06:34:46 UTC
Why this one of the most annoying bugs of the LibreOffice are not fixed again? New version of the Writer released but it is unusable for plenty of people. It has many unnecessary improvements and one of the most annoying bugs! where are your eyes? I'm not developer and I can't write the code, but I try to make the Writer better. Why no one cares about the bug?
Comment 31 Michael Meeks 2012-12-27 16:05:14 UTC
Hi Alexander,

    This is un-called for:

> Why this one of the most annoying bugs of the LibreOffice are not fixed
> again ? 

    Because no volunteer has fixed it, and/or no-one has paid for it to be fixed, and/or no-one has fixed it themselves :-) it is that simple.

> It has many unnecessary improvements and one of the most annoying bugs !

    People work on what they want to, or what they are paid to work on; in general criticising them for their choices is not a winsome strategy to make them work on fixing your particular bug.

    As for not being a programming - all current programmers started as "not yet programmers" such as yourself. Checkout the code, compile it, ask for some code pointers on the list and tinker in this area. Write notes as you do so - anyone could fix this bug: it's just a matter of the investment of enough time and research.

    Thanks !
Comment 32 Cor Nouws 2012-12-27 16:31:18 UTC
@michael: I agree with what you write, that clear description from Alexander (and others) of bugs are very helpful.
Still that brings little relief for his apparent frustration on this issue still standing - which I can understand too.
Comment 33 tommy27 2013-08-20 10:08:56 UTC
@Alexander
do you still experience this bug with recent 4.0.4 or 4.1.0 LibO releases?
Comment 34 Alexander 2013-08-20 14:34:26 UTC
No, I've checked new version 4.1.0 and I haven't experienced the bug.
Comment 35 tommy27 2013-08-20 14:49:02 UTC
@Alexander

OK. let's mark this as RESOLVED WORKSFORME which mean the bug was fixed during LibO development but we don't know exactly which committ did that.

feel free to REOPEN if you see the bug reapper.

reverting version to 3.3.4 which is the first version where the bug appeared (please do not change the version field in the future unless you exactly know what does this mean).