We have recently upgraded to last versions of Aspose Words for Java.
After the upgrade we are receiving many reports of problems while copying the content of an ODT document into a bookmark of a target ODT document. The problems arise when the source document contains numbered lists.
In the final document the numbering of the numbered lists is lost or changed.
The formatting and indentation of the lists in the target document is also altered.
This is the numbered list in the source document:
and this in the final document:
(in red numbered list problems, in blue other formatting issues with bulleted list items)
Here’s a sample code to reproduce the problem (in attach example files)
TEST_documents.zip (71.6 KB)
public static void main(String[] args) throws Exception
{
String path = "c:"; // documents path
testDocumentBookmarks(path+"TEST_testo.odt", path+"TEST_Verbale_modello.odt", "TESTO", path+"TEST_Verbale_compilato.odt");
}
private static void testDocumentBookmarks(String sourceFilename, String templateFilename, String bookmarkName, String outputFilename) throws Exception
{
// Carica il documento di origine (ODT)
Document sourceDoc = new Document(sourceFilename);
// Carica il documento di destinazione (ODT)
Document destDoc = new Document(templateFilename);
boolean ret = importDocumentOri(sourceDoc, destDoc, bookmarkName);
if (!ret) return;
// Salva il documento di destinazione aggiornato (in formato ODT)
destDoc.save(outputFilename);
System.out.println("Output file written: "+outputFilename);
}
private static boolean importDocumentOri(Document sourceDoc, Document destDoc, String bookmarkName) throws Exception
{
// COPY
Document clipboard = sourceDoc.deepClone();
// SELECT A BOOKMARK
Bookmark bm = destDoc.getRange().getBookmarks().get(bookmarkName);
if (bm == null) {
System.out.println("E' stato richiesto di inserire un valore dentro il bookmark " + bookmarkName + ", ma questo non pare esistere nel documento.");
return false;
}
BookmarkStart start = bm.getBookmarkStart();
// PASTE
DocumentBuilder builder = new DocumentBuilder(destDoc);
builder.moveTo(start);
builder.insertDocument(clipboard, ImportFormatMode.KEEP_SOURCE_FORMATTING);
return true;
}
The expected behaviour is to have the numbered lists in the target document with same numering and formatting of the source document.
Please help us to resolve this issue as we cannot downgrade to old vesions of the library.
@fabio.parise
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-28270
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you.
Is there any way to get this issue fixed in the next release of Aspose Words for Java?
@fabio.parise Unfortunately, we cannot promise you anything at the moment. The issue is currently in the queue for analysis.
By the way the problem is reproducible by simple open/save TEST_testo.odt
document using Aspose.Words.
Can you suggest any temporary workarounds while waiting for the fix?
@fabio.parise I am afraid, there is no workaround of the problem.
Hello. We are having a lot of issues with several customers for this problem.
We need to find a workaround. Numbered lists are getting corrupted with random behavior.
Bullets become numbers or letters and vice versa with seemingly nonsensical behavior.
Is there a way to programmatically detect when list formattings get corrupted?
@fabio.parise
Unfortunately, there is no way to detect this programmatically, since corruption occurs upon loading document into Aspose.Words DOM.
I have asked the development team to take a look at the issue as soon as possible. Please accept our apologies for your inconvenience.
Hello, is it possible to have updates about the resolution status of this issue?
We are baffled as to how this kind of issue is still present in 2025.
Is it possible to know in which version of Aspose.Words for Java this bug was introduced?
Thank you
@fabio.parise Unfortunately, there are no news regarding the issue yet. It is currently in analysis. We will keep you update and let you know once it is resolved.
Unfortunately, it is hard to answer this question. Most likely the issue is caused by unusual document structure, which is currently handled incorrectly by Aspose.Words.
I think I’ve identified that the problem was introduced with version 17.7. The release notes talks about changes of list behaviour and Microsoft Word; this seems to have broken behaviour with ODT.
WORDSNET-14504 and WORDSNET-14803 - Changed Importing Behavior of Lists
Previously, list definitions were copied with a new identifier while importing. Now Aspose.Words reuses identical list definitions in the destination. Equality of list definitions in the source and destination is determined by their identifiers. Also Aspose.Words preserves list definition identifiers from the source when equal list definition cannot be found in the destination. This is how MS Word behaves.
https://releases.aspose.com/words/java/release-notes/2017/aspose-words-for-java-17-7-release-notes/#wordsnet-14504-and-wordsnet-14803---changed-importing-behavior-of-lists
@fabio.parise Thank you for additional information. We will keep you update and let you know once the problem is resolved.
I would like to point out that we are receiving dozens of reports regarding this problem, all from different customers. These are all customers who have chosen to use the OpenOffice or LibreOffice suites as business tools.
This is not an isolated case.
@fabio.parise I will forward the information to our development team.
The issues you have found earlier (filed as WORDSNET-28270) have been fixed in this Aspose.Words for Java 25.7 update.