Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active August 15, 2022 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/0579a73a26bd2b7d4dfff229d0f4ea3f to your computer and use it in GitHub Desktop.
Save aspose-com-gists/0579a73a26bd2b7d4dfff229d0f4ea3f to your computer and use it in GitHub Desktop.
Merge or Combine OneNote Files in Java
// Load the OneNote .one file using Document class
com.aspose.note.Document oneSource = new com.aspose.note.Document(dataDir + "Sample1.one");
// Load the destination OneNote file
com.aspose.note.Document oneDestination = new com.aspose.note.Document(dataDir + "Quick Notes.one");
// Clone each page of the input file
for (com.aspose.note.Page page: oneSource)
{
oneDestination.appendChildLast(page.deepClone());
}
// Save OneNote document
oneDestination.save(dataDir + "MergedOutput.pdf" , com.aspose.note.SaveFormat.Pdf);
// Load the OneNote .one file using Document class
com.aspose.note.Document oneSource = new com.aspose.note.Document(dataDir + "Sample1.one");
// Load the destination OneNote file
com.aspose.note.Document oneDestination = new com.aspose.note.Document(dataDir + "Quick Notes.one");
// Clone each page of the input file
for (com.aspose.note.Page page: oneSource)
{
oneDestination.appendChildLast(page.deepClone());
}
// Save OneNote document
oneDestination.save(dataDir + "MergedOutput.one");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment