Env used: Docker Image with .NET Core 6.0 and Windows 11 IIS with .NET Core 6.0
I create the PDF by code, you can reproduce the problem with the code below:
byte[]? docByte = null;
var x = new Aspose.Pdf.Document();
using (var memorystream = new MemoryStream())
{
x.Save(memorystream, Aspose.Pdf.SaveFormat.DocX);
memorystream.Seek(0, SeekOrigin.Begin);
docByte = memorystream.ToArray();
}
return docByte;
Instead of Aspose.PDF for .NET, we request you please use Aspose.Pdf.Drawing and if issue still persists, kindly share the docker file for our reference so that we can investigate with the same configuration and address the issue accordingly.
While testing the scenario using 23.10 version of the API in our environment, we noticed different exception that displayed the meaningful error description: image.png (3.9 KB)
After adding the page in the document, the code was executed just fine.
byte[]? docByte = null;
var x = new Aspose.Pdf.Document();
x.Pages.Add();
using (var memorystream = new MemoryStream())
{
x.Save(memorystream, Aspose.Pdf.SaveFormat.DocX);
memorystream.Seek(0, SeekOrigin.Begin);
docByte = memorystream.ToArray();
}