Page.Clone

Page.Clone method

Clones the page.

public Page Clone(bool cloneHistory = false)
ParameterTypeDescription
cloneHistoryBooleanSpecifies if page’s history should be cloned..

Return Value

A clone of the page.

Examples

Shows how to push current version of a page to history.

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Pages();

// Load OneNote document and get first child           
Document document = new Document(dataDir + "Aspose.one");
Page page = document.FirstChild;

var pageHistory = document.GetPageHistory(page);

pageHistory.Add(page.Clone());

document.Save(dataDir + "PushCurrentPageVersion_out.one");

Shows how to clone a page.

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Pages();

// Load OneNote document
Document document = new Document(dataDir + "Aspose.one", new LoadOptions { LoadHistory = true });

// Clone into new document without history
var cloned = new Document();
cloned.AppendChildLast(document.FirstChild.Clone());

// Clone into new document with history
cloned = new Document();
cloned.AppendChildLast(document.FirstChild.Clone(true));

See Also