Hi,
Please use the attached document files in the following code. I use a template document to which I am adding content of 2 other documents. Number type of some paragraphs in the second document changes from “bullet” to “numbered” after it is inserted to the result document.
If the second document is inserted to the template alone (without the first document), all paragraphs are inserted correctly, with the correct number type.
Also, this does not happen with any documents/examples. The second document has been originally generated by Aspose API, where the style and list and indents were set for these paragraphs. After the document was generated, for the third paragraph in that document, I have manually set “List Bullet” style in Word. The appearance of the paragraph did not change, however, something changed that causes that the third paragraph is inserted correctly now to the template in the example below.
Here is the code:
Document doc = new Document("src/data/clean-template.docx");
Document doc1 = new Document("src/data/ numberlist.docx");
Document doc2 = new Document("src/data/bullets.docx");
Node docSection = doc1.getChildNodes(NodeType.SECTION, true).get(0);
doc.appendChild(doc.importNode(docSection, true));
docSection = doc2.getChildNodes(NodeType.SECTION, true).get(0);
doc.appendChild(doc.importNode(docSection, true));
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.DOCX);
saveOptions.setCompliance(OoxmlCompliance.ISO_29500_2008_TRANSITIONAL);
doc.save("src/data/output.docx", saveOptions);
Any help in this matter would be appreciated.
If there is a way to use Aspose API to simulate the “style” assignment I did in Word for the third paragraph in the bullets.docx document the way that it would result in correct imported result, please let me know.
Thank you very much,
Natasa