1

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.

Jacques
  • 747
  • 1
  • 8
  • 19
  • We have already replied to same query posted by you over Aspose forum. Kindly follow up in respective thread. **PS:** I work with Aspose as Developer Evangelist. – Farhan Raza Jun 20 '18 at 20:02
  • Hi @FarhanRaza, I have responded accordingly on the Aspose forum. – Jacques Jun 21 '18 at 00:15
  • Thank you for the acknowledgement. We will get back to you after investigating the scenario in our environment. – Farhan Raza Jun 21 '18 at 05:32

0 Answers0