Free Support Forum - aspose.com

OneNote crash when exporting to docx

Hello support,

we create a one note file (*.ONE) with Aspose.note. When we open this file in OneNote, we experience the following behavior:

  1. When selecting parts of the document’s content, and then moving the mouse over the selected area, OneNote crashes. This behavior is not deterministic, meaning it happens often, but not always.

  2. When we export this file in OneNote to docx, OneNote is ALWAYS crashing.

I attach an example of a file that’s been created with Aspose.NOTE, and has the said problems. Can you please help us with this?

Thank you!

Questionnaire Entity 2 (ohne Anhang).one.zip (9.1 KB)

@stb_ag,
Regarding issue 1, share a movie which shows this issue as we are not able to reproduce it here.
For the second issue, we can observed the crash problem while exporting it to docx.

Please note that we need the runnable sample code which is used to create this OneNote file for analysis and further assistance as without the sample code it is not possible to provide our feedback. Once we receive the desired information, we will reproduce this issue here and log it in our database for a fix.

Hello,

thank you for your answer. I send you my eclipse project, which produces one note files with the said problem. The main class is com.audimex.ee.simplereport.GuidelineList. The program needs one parameter, containing the files it needs to run. This directory is specified as command line parameter -p /tmp/dok4 (example). I attach such a directory also.
Concerning the movie: I will try to produce this and deliver it as soon as I got it.

Kind regards,
Markus dok4.zip (14.9 KB)
ee-onenote.zip (71.9 KB)

@stb_ag,
We are working on this issue and need assistance. Could you please share what argument you pass to this program? If that file is not already shared, please share the file with us for our testing.

The parameter is, as I wrote in my previous message:

-p

Included in my previous mail, you find a file “dok4.zip”. Unzip it, it contains a directory with the name “dok4”. is the full path to this directory. It should contain everything needed.

it is

-p <folder>

The “<folder>” has disappeared in my last message…

And here is the video you requested. It shows the crash of OneNote while just only selecting text areas in the created file.GSA.mp4.zip (563.2 KB)

I have observed this folder. It contains “result.one” file which is analyzed first by directly opening it in Microsoft OneNote and then exported to DOCX. It can be seen that OneNote crashes here which shows that there is some issue with this file as no Aspose.Note is used during this test. Could you please test this file at your end and share the feedback as this issue of crashing OneNote is reproduced using the original file without any change?

Regarding the selected text issue, I tried this with result.one file but not able to reproduce it. I have following view when I open the result.one file and hover mouse over the selected text. No crash is observed however once we are able to create this file here, we will check this issue again.

SelectedTextIssue.png (108.7 KB)

We need a code which creates a .ONE file from scratch and when this output file is opened in MS OneNote and exported to DOCX, it should crash MS OneNote for our testing. You may share the code which is used to create ‘result.one’ using Aspose.Note.

We are sorry for the inconvenience in this regard.

This file result.one has been produced with Aspose on our end. And it crashes Notes when exporting to DOCX, as you confirmed. I think the mistake is that you thought, result.one would be a file created with OneNote. But it is not. It is built from scratch with Aspose.Note from the project I sent to you. When you execute the project with the parameters I sent, result.one will be replaced by the newly generated file.
It is not too surprising to me, that you cannot reproduce the crash with the selected text. We can also not reproduce it in a deterministic way, this only happens on our client’s side. But when we examined this crash, we found out the crash that occurs by exporting the document to docx. So we think that both are possibly related to each other.

Just to state it clearly: You have the code that produces what you request, I sent you the whole project.

@stb_ag,
I am afraid that I could not find the sample code which is used to create this file from scratch. Following is the main function provided in your sample project:

 if (args.length != 1) {
            USAGE();
            return;
        }

        String filePath = args[0];
        File file = new File(filePath);
        if ((!file.exists()) || (!file.isFile())) {
            System.err.println(String.format("File does not exist: %s", filePath));
            return;
        }

        try {
            // Load the document into Aspose.Note
            Notebook nb = new Notebook(filePath);
            System.out.println(XmlConvert.convertToXML(nb));
        } catch (UnsupportedFileFormatException e1) {
            try {
                Document doc = new Document(filePath);
                System.out.println(XmlConvert.convertToXML(doc));
            } catch (UnsupportedFileFormatException e2) {
                System.err.println(String.format("Unsupported file format (allowed: one, onetoc2): %s", filePath));
                return;
            } catch (Exception e3) {
                System.err.println(e3.toString());
                return;
            }
        } catch (Exception e4) {
            System.err.println(e4.toString());
            return;
        }

When we run this code, it reads a file and converts it to XML. Could you please assist me how to use this code to create result.one file from scratch for my reference?

As wrote in my 2nd message (see above), the main class is:

com.audimex.ee.simplereport.GuidelineList

This class contains a main method which can be called with a command line parameter

-p

where is the path to the folder contained in the zip archive dok4.zip which I sent.

-p directory

where directory is the path to the folder contained in the zip archive dok4.zip which I sent.