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?


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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.

Hi!
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 4.0.2.0.


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Sections are not pages. Please see the following link to learn more about sections:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/working-with-sections.html

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?


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I suppose, you would like to achieve the same as the following article describes:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/howto-produce-multiple-documents-during-mail-merge.html

Hope this information could help you.

Best regards.