We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose PDF Not working on AWS Lambda

we are using ASPOSE Pdf library for Converting pdf to image in dot net Core Application and deployed on AWS Lambda function.

MemoryStream oMemory = new MemoryStream();
Aspose.Pdf.Devices.Resolution oResolution = new Aspose.Pdf.Devices.Resolution(300);
Aspose.Pdf.Devices.JpegDevice pngDevice = new Aspose.Pdf.Devices.JpegDevice(oResolution);
pngDevice.Process(oDoc.Pages[i], oMemory);
Getting exception :
The type initializer for ‘Gdip’ threw an exception.: TypeInitializationException
at System.Drawing.SafeNativeMethods.Gdip.GdipCreateMatrix2(Single m11, Single m12, Single m21, Single m22, Single dx, Single dy, IntPtr& matrix)


Could you please attach the following resources here for testing:

  • Your input PDF.
  • Please create Visual Studio application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
  • Please share detail about your working environment e.g. operating system, .NET framework etc.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Here we have solution in dot net core and we have created lambda function.
We deployed this on AWS lambda which is using linux environment internally.
and when we call pngDevice.Process(oDoc.Pages[i], oMemory); here we are getting exception.
This code internally uses System.Drawing.


We have logged this problem in our issue tracking system as PDFNET-52348. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.