This short tutorial guides on how to convert OneNote to Word using Java. It has detailed information to set the environment for using Aspose.Note and Aspose.Words for converting .ONE file to .DOC, a list of steps for developing the application, and a runnable sample code to do OneNote export to Word using Java. Different options will be discussed to customize the loading of the .ONE file and saving the resultant DOC file.
Steps to Change OneNote to DOC using Java
- Set the environment to use Aspose.Note and Aspose.Words for OneNote to Word conversion
- Load the .ONE file into the Document object of Aspose.Note for conversion to HTML
- Save the resultant HTML file on the disk
- Load the HTML file for conversion to a DOC file
- Save the resultant file as DOC on the disk
These steps summarize the process to transform OneNote to DOC using Java. The process is commenced by loading the source OneNote file into the Document class of the Aspose.Note library followed by saving the loaded file as an HTML file. Once the HTML file is saved, it is loaded into the Document class of the Aspose.Words class and finally saved as the DOC file.
Code to Transform OneNote to Word using Java
public class Main { | |
public static void main(String[] args) throws Exception // .ONE to DOC in Java | |
{ | |
// Set the licenses | |
new com.aspose.note.License().setLicense("Aspose.Total.lic"); | |
new com.aspose.words.License().setLicense("Aspose.Total.lic"); | |
// Convert .ONE to HTML | |
com.aspose.note.Document doc = new com.aspose.note.Document("Aspose.One"); | |
doc.save("output.html", com.aspose.note.SaveFormat.Html); | |
// Convert HTML to DOC | |
com.aspose.words.Document document = new com.aspose.words.Document("output.html"); | |
// Save the DOC | |
document.save("output.doc", com.aspose.words.SaveFormat.DOC); | |
System.out.println("Done"); | |
} | |
} |
This article has guided us to convert OneNote to DOC using Java. If you want to learn the process to convert the OneNote file to PDF, refer to the article on how to convert OneNote to PDF using Java.