Aspose.Words

Cloning a Document

If you need to generate hundreds or thousands of documents from a single document, just load the document into memory once, clone it, and populate the cloned document with your data. This speeds up the generation of documents because there is no need to load and parse the document from file every time. Cloning is done with the Document.Clone method that performs a deep copy of the Document and returns it.

Example CloneDocument

Shows how to deep clone a document.

[Java]

 

Document doc = new Document(getMyDir() + "Document.doc");

Document clone = doc.deepClone();