Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active June 15, 2021 12:06
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/31355c0db52fee1619cd6cb8488086c8 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/31355c0db52fee1619cd6cb8488086c8 to your computer and use it in GitHub Desktop.
Convert OneNote File .one to PNG JPG TIFF Image Programmatically using Java
// Load the OneNote file using Document class.
Document oneFile = new Document("Aspose.one");
// Initialize ImageSaveOptions and specify SaveFormat.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Tiff);
// Set color mode for GrayScale TIFF output
options.setColorMode(ColorMode.GrayScale);
// Save output file
oneFile.save("SaveToTiffGrayscale.tiff", options);
// Load the input Note (.one) file using the Document class.
Document oneFile = new Document("Aspose.one");
// Save output JPG image.
oneFile.save("SaveToJpegImageUsingSaveFormat_out.jpg", SaveFormat.Jpeg);
// Load the document into Aspose.Note.
Document oneFile = new Document("Aspose.one");
// Initialize ImageSaveOptions class object.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);
// Save the output PNG image.
oneFile.save("SaveAsPNG.png", options);
// Load the note file using Document class
Document oneFile = new Document("Aspose.one");
// Initialize ImageSaveOptions and specify SaveFormat
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Tiff);
// Set ColorMode to Black and White
options.setColorMode(ColorMode.BlackAndWhite);
// Set Compression Type specific for Black and White image
options.setTiffCompression(TiffCompression.Ccitt3);
// Save output TIFF file
oneFile.save("SaveToTiffBlackAndWhite.tiff", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment