Different display of a docx file in ms office word and onlyoffice

Hello OnlyOffice team!

Environment: onlyoffice/documentserver:9.2.1 (deployed via Docker)

We are experiencing rendering differences between ONLYOFFICE and MS Word when working with the same DOCX file. The document layout differs specifically in pagination and table row rendering.

To investigate the root cause, we took the original DOCX file, renamed it to ZIP, extracted its contents, and inspected word/document.xml. The XML fragments below come directly from that file. Based on this analysis, we believe the issue is related to how ONLYOFFICE processes these specific elements. We would appreciate your feedback on whether our understanding is correct.

Case 1: Vertical Merge (vMerge) causes unwanted page break

In a table, we have a cell with <w:vMerge w:val="restart"/>. The row has a small fixed height:

<w:trPr>
  <w:trHeight w:val="42"/>
</w:trPr>

The second column contains the text “test info 123” inside a merged cell:

<w:tc>
  <w:tcPr>
    <w:tcW w:w="2995" w:type="dxa"/>
    <w:vMerge w:val="restart"/>
    <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
  </w:tcPr>
  <w:p>
    <w:r>
      <w:t>test info 123</w:t>
    </w:r>
  </w:p>
</w:tc>
  • MS Word renders the row on a single page, automatically expanding the row height to fit the content.
  • ONLYOFFICE does not expand the row and moves the content to the next page, breaking the expected layout.

Case 2: <w:lastRenderedPageBreak/> is interpreted differently

We have two paragraphs. The second paragraph contains a <w:lastRenderedPageBreak/> tag inside a run, right before the text:

<w:r>
  <w:rPr>...</w:rPr>
  <w:lastRenderedPageBreak/>
  <w:t>«test info 456...</w:t>
</w:r>
  • MS Word treats this tag as a rendering hint and recalculates the layout. As a result, the text starting with «test info 456…» is moved to the next page.
  • ONLYOFFICE keeps this text on the same page as the previous paragraph, causing a page layout mismatch.

Question: Beyond these specific cases, is there any configuration, setting, or option in onlyoffice/documentserver:9.2.1 that improves overall compatibility with MS Word rendering? We would like ONLYOFFICE to display DOCX files as closely as possible to how MS Word renders them — ideally with minimal manual intervention.

Thank you.

Hello,

Thank you for the detailed description and the XML fragments.

We checked both scenarios on the latest version of ONLYOFFICE Docs, but were not able to reproduce the described behavior:

  • For the table with w:vMerge and w:trHeight, we did not reproduce an unexpected page break or a difference in pagination compared with Microsoft Word.
  • For the paragraph containing w:lastRenderedPageBreak, the text remained on the same page in both ONLYOFFICE Docs and Microsoft Word during our test.

Could you attach the original DOCX file in which the issue occurs? Please provide the file without opening and resaving it in ONLYOFFICE or Microsoft Word before uploading it. Additionally, please let us know where and how this document was originally created.

Please update your Docker deployment from onlyoffice/documentserver:9.2.1 to the latest available version and re-check the issue. New versions include numerous fixes and improvements, so the behavior may already be resolved in a newer release.

If the issue still occurs after the update, please send a short video showing the complete reproduction scenario, or screenshots from ONLYOFFICE and Microsoft Word showing the same document area and page number.

Thank you.