Creating digital notes is like an everyday activity these days. Many people keep notes including text, drawings, pictures, and much more. You can convert such notes to images programmatically using Java. OneNote file can be rendered to JPG, PNG, as well as TIFF image with different color modes and compressions. The following sections discuss the conversions in detail:
- OneNote to Image Converter – Java API Installation
- Convert OneNote to JPG Image File Programmatically using Java
- Convert OneNote to PNG Image Programmatically using Java
- OneNote File to Grayscale TIFF Image Conversion in Java
- Convert OneNote to TIFF in Black and White Color with Compression using Java
OneNote to Image Converter – Java API Installation
You can convert a OneNote file to an Image with Aspose.Note for Java API. Simply configure the API by downloading the JAR file from the New Releases section, or with the following Maven configurations in pom.xml file of your project:
Repository
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
</repositories>
Dependency
<dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-note</artifactId>
<version>21.5</version>
<classifier>jdk17</classifier>
</dependency>
</dependencies>
Convert OneNote to JPG Image File Programmatically using Java
You can convert a OneNote file to JPG image with the following steps:
- Load the input Note (.one) file using the Document class.
- Save output JPG image.
The code below shows how to convert a .one OneNote file to JPG image programmatically using Java:
Convert OneNote to PNG Image Programmatically using Java
You can convert a OneNote file to PNG image with below steps:
- Load the input file using Document class.
- Initialize ImageSaveOptions class object.
- Save the output PNG image.
The following code explains how to convert OneNote file to a PNG image programmatically with Java:
OneNote File to Grayscale TIFF Image Conversion in Java
You can convert .one files to image format while specifying the color modes as per your requirements. Please follow the following steps to convert a OneNote file to Grayscale TIFF image:
- Load the OneNote file using Document class.
- Initialize ImageSaveOptions and specify SaveFormat.
- Set color mode for GrayScale TIFF output.
- Save output image.
The code below demonstrates how to convert a .ONE file to a TIFF image with GrayScale color scheme programmatically using Java:
Convert OneNote to TIFF in Black and White Color with Compression using Java
Several compression algorithms are supported by the API and you can convert the OneNote file to black and white tiff image with compression using Java. You need to follow the steps below for converting the .one file to TIFF image:
- Load the note file using Document class.
- Initialize ImageSaveOptions and SaveFormat objects.
- Set ColorMode to Black and White.
- Set the compression type specific for the Black and White image.
- Finally, save the output TIFF file.
The following code explains how to convert a .ONE file to a black and white TIFF image programmatically with Java:
Get Free API License
You can request a Free Temporary License to test the API in full capacity.
Conclusion
In conclusion, you have learned how to convert OneNote files (.one) to different image formats like PNG, JPG, and TIFF with different color modes and compression algorithms programmatically using Java. Moreover, please take a look at API Documentation to explore other features. In case of any questions, please feel free to reach out to us at the Free Support Forum.