Microsoft OneNote Conversion Via Java
Convert Microsoft OneNote to PDF and Images including BMP, JPG, PNG, TIFF to build cross-platform Java applications.
Aspose.Note for Java is a feature-rich OneNote API that enables the Java applications to dynamically interact with OneNote documents without requiring any other software. API empowers the developers to create, read, manipulate and export the contents of the Microsoft OneNote file format. The API also allows managing attachments, text, hyperlinks, tables, tags and text styles.
The OneNote API is easy to use, saves time, and developers can create robust solutions with less code. On top of it, it is a standalone component that does not require any other tools or software to work with OneNote files. Whenever there is need to manipulate Microsoft OneNote files within your organization custom built software, OneNote API helps to do it by enhancing your application functionality. It is a standalone API without needing Microsoft OneNote installation or any other software. Programmers can easily integrate it for transforming .one extension files to the desired format like BMP, GIF, JPEG, PNG or TIFF image formats or PDF files.
Convert OneNote to Images JPG, PNG, BMP, TIFF
Using OneNote API, developers can easily convert Microsoft® OneNote one / onetoc2 to image formats. Conversion process is, Load the Note files using Document class . Create ImageSaveOptions object with SaveFormat.Imageformat to be used as parameter within SaveFormat . Other than desktop software solutions, it is easy to integrate within webbased applications for browser based one to image conversion solutions.
Java Code for Microsoft OneNote to Image Files Conversion
1. // Path of document directory.
2. String dirPath = Utils.getSharedDataDir(SaveOneNoteDocToStream.class) + "load/";
3.
4. // Load the file into Aspose.Note using Document class.
5. Document oneFile = new Document(dirPath + "sourceFile.one");
6.
7. // Images conversion options
8. ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Jpeg);
9.
10. String outputFile = dirPath + "oneToImage.jpeg";
11.
12. // Save the document.
13. oneFile.save(outputFile, options);
OneNote to PDF Conversion
As of images conversion, Process of converting OneNote one and onetoc2 to PDF is almost same. Using Document class , load OneNote files. After loading the document, call the save method with outout PDF file and SaveFormat .Pdf as parameters. Conversion time varies from file to file depending on document size.
Java Code to Convert OneNote to PDF
1. // The path to the documents directory.
2. String dirPath = Utils.getSharedDataDir(SaveOneNoteDocToStream.class) + "load/";
3.
4. // Load the document into Aspose.Note.
5. Document oneFile = new Document(dirPath + "sourceFile.one");
6.
7. dirPath = dirPath + "oneFiletoPdf_out.pdf";
8.
9. // Save the document.
10. oneFile.save(dirPath, new PdfSaveOptions());