Free Support Forum - aspose.com

Append document - list format issue

Hi,
I’m trying to append one document to another using this code :

Document document = new Document(“E:\doc1.doc”);
Document docToAppend= new Document(“E:\doc2.doc”);
document.appendDocument(docToAppend, ImportFormatMode.KEEP_SOURCE_FORMATTING);

The problem is that in the result document there are some differences in list style.
I’m attaching documents and screen with details.
I guess that problem is with some document (doc1.doc) settings because if I create brand new document it works fine.

Thanks in advance for help.

Hi,


Thanks for your request. I have checked the issue with the latest version of Aspose.Words and could not reproduce it. Please try using the latest version; you can download it from here:


http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/category1378.aspx

Best Regards,


Nabeel Ahmad

Hi,
I’ve tried the latest version. It gives the same result.
I’m attaching result document.

Hello

Thank you for additional information. It is expected behavior. If you try checking DefaultTabStops in your destination and source documents you will see the difference. Please try using the following code:

Document document = new Document("C:\\Temp\\doc1.doc");

// Check Default Tab Stop

System.out.println(document.getDefaultTabStop());

// Set Default Tab Stop

document.setDefaultTabStop(35.4);

Document docToAppend= new Document("C:\\Temp\\doc2.doc");

// Check Default Tab Stop

System.out.println(docToAppend.getDefaultTabStop());

document.appendDocument(docToAppend, ImportFormatMode.KEEP_SOURCE_FORMATTING);

document.save("C:\\Temp\\out.doc");

Or you can change DefaultTabStop manually in MS Word.

Best regards,