In specific cases, calling ParagraphFormat.setLinesToDrop() will result in invalid ODT output.
To demonstrate I’ve constructed the following sample code fragment:
Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
current = builder.getCurrentParagraph();
p = new Paragraph(document);
r = new Run(document, “hello world”);
Cell cell = builder.insertCell();
cell = builder.insertCell();
p = cell.getFirstParagraph();
p.appendChild(new Run(document, “sdfdsfe wf ef ew fs”));
When you run this with the latest version of Aspose.Words for Java and open it in LibreOffice writer you will notice that the table is not there. When you try to open it in MS Word it will state that the document is invalid.
Now comment out the following line:
and run the sample again. You will notice that the table now appears as it should. While examining the ODT output it became clear that when the setLinesToDrop call is performed, the table ends up inside a paragraph element, which is illegal odt. LibreOffice writer probably just ignores the illegal fragment while MS Word is less forgiving and displays an error that the document is invalid.
If someone from the Aspose team could verify this problem and report back it would be much appreciated.