Free Support Forum - aspose.com

NullReferenceException when converting .docx to pdf last version 20.6 Aspose Total

I need help.

I have troubles in converting the attached document. We applied the following code.

Aspose.Words.Document document = new Aspose.Words.Document(stream); Aspose.Words.Saving.PdfSaveOptions saveOption = new Aspose.Words.Saving.PdfSaveOptions() {
SaveFormat = Aspose.Words.SaveFormat.Pdf,
OutlineOptions = { HeadingsOutlineLevels = 9 }
};
document.Save(outputFilePath, saveOption);

Error:

  • System.NullReferenceException: Object reference not set to an instance of an object.

    at
    ? .

()

at .

()

at ? .[1]( [1], Int32

, Boolean , Boolean )

at
.
()

at
. ()

at
.

( [1], Int32

)

at
.[1]( [1], Int32

)

at ? .

( [1])

at ? .1

at ? .[1](? [1])

at .1

at

.1

at [1] .[1] ()

at .

()

at Aspose.Words.Document.UpdatePageLayout()

at ? . ? ? 1

at ? .

(?? [1])

at ?? .[1](?? [1], ??

)

at ?? .[1](Node [1], ??

)

at Aspose.Words.Document.()

at Aspose.Words.Document.[1]([1]? [1])

at Aspose.Words.Document.[1](Stream [1], String

, SaveOptions )

Attachment download:
doc error.zip (344.8 KB)

Thanks for support!

@federicogelpi

We have tested the scenario using the latest version of Aspose.Words for .NET 20.7 and have not found the shared issue. So, please Aspose.Words for .NET 20.7.