I get the following error when trying to convert a PDF page to an image. ERROR:region.c:1155:GdipCombineRegionPath: assertion failed: (region->bitmap)
Project Setup:
- Aspose.Pdf Version: 18.6.0
- Framework: .NET Core 2.1
- Type: Console Application
- Docker container used: microsoft/dotnet:2.1.0-runtime
Source PDF file
Size: 181 KB
Page count: 4
Sample code:
public ImageData GenerateImage(byte[] pdfData, int pageNo)
{
var imageStream = new MemoryStream();
var pdfMemoryStream = new MemoryStream(pdfData);
var pdfDocument = new Document(pdfMemoryStream);
Resolution resolution = new Resolution(300);
var pageToPrint = pdfDocument.Pages[pageNo];
PngDevice pngDevice = new PngDevice(resolution);
//This line causes the error
pngDevice.Process(pageToPrint, imageStream );
}
Notes: This works fine on a Windows machine but produces the error on a Linux 64bit Docker container.
Please see this link for the actual crash dump from the container: Aspose Forum Question
Any help would be appreciated.