We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

What does deepClone exactly do?

I know that one document is represent as a DOM in memory.
My question is: after calling document.deepClone(), will there are two DOM in the memory or just one?


Thanks for your request. Document.deepClone() performs a deep copy of the Document, i.e. it created full copy of the Document instance in the memory. So yes, after cloning there are two DOMs in the memory.
Best regards.

Many thanks to your answer.
I have write a program to test deep clone.
I’m very confused about “output1.docx” and “output2.docx” (You can get them from the attachment.). Why there are two sections in both of them? They are supposed to have only one page, not two.
I’m using Aspose.word for java jdk16 version


Thanks for your inquiry. Sections are not pages. Please see the following link to learn more about sections:
Also, you can see section break in both of your documents. Most likely, you insert these break in your code. Could you please provide me your code? I will check it and provide you more information.
Best regards.

Thanks. The code and template document are also in the attachment.
I have read the document on your website very carefully and know the differences between section and page.

My ultimate goal is to generate two different documents based on one template using deep clone.
But the output are the same… why?


Thank you for additional information. I suppose, you would like to achieve the same as the following article describes:
Hope this information could help you.
Best regards.