test.zip (46.6 KB)
We are using Aspose.Words for .NET version 19.12, but I have also managed to reproduce the problem on 20.1
The code is as follows:
var doc = new Aspose.Words.Document(@"test.docx");
doc.AcceptAllRevisions();
int quality = 80;
var imageSaveOptions = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg);
imageSaveOptions.JpegQuality = quality;
imageSaveOptions.Resolution = 150;
imageSaveOptions.PageCount = 1;
var startPage = 0;
for (int counter = startPage; counter < doc.PageCount; counter++)
{
imageSaveOptions.PageIndex = counter;
using (var imageStream = new MemoryStream())
{
doc.Save(imageStream, imageSaveOptions);
}
}
the call to doc.Save(…) throws a NullReferenceException on the first page of the file.
Please find the problematic file test.docx attached in the ZIP.
Please let us know when this can be fixed.