I want to convert a .onepkg file to pdf.
See the document on supported file formats list by Aspose.Note for your reference. Could you please share .onepkg file, we can look into it.
PS. please zip the file(s) prior attaching.
Thanks for the sample .onepkg file.
The .onepkg file format may not be supported by Aspose.Note. So, when loading the .onepkg, into Aspose.Note for Java object model, it gives me an error:
e.g.,
“com.aspose.note.UnsupportedFileFormatException: Unsupported file type”.
I have logged a ticket with an id “NOTEJAVA-1140” for your issue/requirements. We will look into it if we can support it.
Once we have an update on it, we will let you know.
We apologize that the issue has not been resolved yet. We will schedule it and make an effort to fix it as soon as possible. Once we have any updates or an estimated time of completion, we will inform you.
We evaluated your requirements in details. Please note, files with the extension .onepkg are basically archives containing .one and .onetoc2 files. To access them, you can use the code below (in addition to the Aspose.Note library, it also utilizes the Aspose.Zip (.NET) library).
var onePkgFilePath = "";
var onePkgExtractDirectory = "";
using (var archive = new Aspose.Zip.Cab.CabArchive(onePkgFilePath))
{
archive.ExtractToDirectory(onePkgExtractDirectory);
}
var oneFiles = Directory.GetFiles(onePkgExtractDirectory)
.Where(file => file.EndsWith(".one", StringComparison.OrdinalIgnoreCase))
.ToArray();
var oneTocFiles = Directory.GetFiles(onePkgExtractDirectory)
.Where(file => file.EndsWith(".onetoc2", StringComparison.OrdinalIgnoreCase))
.ToArray();
var documents = oneFiles.Select(oneFile => new Document(oneFile)).ToArray();
var notebooks = oneTocFiles.Select(oneTocFile => new Notebook(oneTocFile)).ToArray();
Afterwards, you can save either each .one file or the entire notebook in PDF format via Aspose.Note.