Convert or Save OneNote documents to PDF, Image and other formats in Java
Converting OneNote Document to PDF
PDF documents are widely used as a standard format of exchanging documents between organizations, government sectors and individuals. It’s a popular format so developers are often asked to convert Microsoft OneNote documents to PDF documents. For this purpose, Aspose.Note for Java supports converting OneNote to PDF documents without using any other component. This topic illustrates how this conversion can be done.
Aspose.Note for Java offers the Document class that represents a OneNote file. The Document class exposes the Save method that can be called to convert a OneNote document into a PDF document. The PdfSaveOptions class provides options for creating the PDF such as PageIndex, PageCount and others.
This article shows how to:
Converting OneNote to PDF using the Default Options
The following example shows how to convert a OneNote into a PDF document using the default options. The default options create a PDF document of the maximum quality.
Converting a Specified Page Range of OneNote to PDF
The following example shows how to convert a OneNote into a PDF document with a specified page range as provided by the PdfSaveOptions class. It sets the PageIndex and PageCount properties.
Converting OneNote to PDF with replacing of missing fonts
The following code example demonstrates how to set default font name.
The following code example demonstrates how to set font from a file as default.
The following code example demonstrates how to set font from a stream as default.
Converting OneNote to Image
Aspose.Note supports converting OneNote file to images. To use this feature, import the Aspose.Note.Saving namespace into your application project. It has numerous valuable classes for rendering, for example ImageSaveOptions, PdfSaveOptions, and SaveOptions.
Aspose.Note API offers the Document class that represents a OneNote file. The Document class exposes the Save method that can be called to convert the OneNote file into an image format. The ImageSaveOptions class provides options for creating PNG, GIF, JPEG or BMP files, such as PageIndex, SaveFormat and others.
This article shows how to:
- Save OneNote as an image with the default settings.
- Save a particular page of OneNote as an image.
- Set Output Image Resolution
Converting OneNote to Image using the Default Options
The following example shows how to convert a OneNote into an image using the default options.
Converting a Specific Page in a OneNote Document to Image
The following example shows how to convert a specific page in a OneNote file into an image using the ImageSaveOptions class. It sets the PageIndex properties.
Set Output Image Resolution
The setResolution method of ImageSaveOptions allows specifying the output image resolution of the converted document.