Hello,
I have problem while converting OneNote files to pdf with Aspose Note for Java 19.04. I use the following code for the pdf conversion:
com.aspose.note.Document oneNoteDoc = new com.aspose.note.Document(sourceFile.getPath());
oneNoteDoc.save(targetFile.getPath(), SaveFileFormat.PDF);
The created pdf file can not be opened with Adobe Reader. The OneNote file is created with MS-Office 2016. Can you tell me how can I convert the OneNote file to pdf?
TestFile.zip (3.5 KB)
Best regards
@Anwender,
I have tried this file with the latest version Aspose.Note for Java 19.4 but could not observe any issue. It seems that you are using some older version as SaveFileFormat enumerator is not found in the latest version. Please try the scenario using above mentioned latest version with the following sample code and share the feedback. The output file is attached here for your reference.
com.aspose.note.Document oneNoteDoc = new com.aspose.note.Document("TestFile.one");
try {
oneNoteDoc.save("outputJava.pdf", SaveFormat.Pdf);
} catch (IOException e) {
e.printStackTrace();
}
outputJava.pdf (20.9 KB)
Ok, I solved the problem. I use in my program the right saveformat “import com.aspose.note.SaveFormat;” and the PDF-conversion works. I will make some additional conversion tests. Thank you for the feedback!
@Anwender,
Good to know that your issue is sorted out by the suggested API with newer version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.