When calling document.Save() as PNG in an AWS Lambda the code fails with the below exception
{
"errorType": "AggregateException",
"errorMessage": "One or more errors occurred. (The type initializer for '\u0002 ' threw an exception.)",
"stackTrace": [
"at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
],
"cause": {
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for '\u0002 ' threw an exception.",
"stackTrace": [
"at \b .\u0002()",
"at \b .\u0002(Stream \u0002)",
"at \u0005 .\u0005 \u0002(\u0003 \u0002)",
"at \u000f .\u000f \u0002(\u0003 \u0002)",
"at Aspose.Words.Document.\u0002(\u0003 \u0002, SaveOptions \u0003)",
"at Aspose.Words.Document.\u0002(Stream \u0002, String \u0003, SaveOptions \u0005)",
"at OfficeDocToImage.Function.ConvertWordToImages(AmazonS3Client client, GetObjectResponse response, String s3Folder, String s3Bucket, OfficeDocToImageRequest request) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 148",
"at OfficeDocToImage.Function.FunctionHandler(APIGatewayProxyRequest apiRequest, ILambdaContext context) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 72"
],
"cause": {
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.",
"stackTrace": [
"at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, Boolean isOpaque)",
"at \u0002 ..cctor()"
],
"cause": {
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory",
"stackTrace": [
"at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()",
"at SkiaSharp.SKImageInfo..cctor()"
]
}
}
},
"causes": [
{
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for '\u0002 ' threw an exception.",
"stackTrace": [
"at \b .\u0002()",
"at \b .\u0002(Stream \u0002)",
"at \u0005 .\u0005 \u0002(\u0003 \u0002)",
"at \u000f .\u000f \u0002(\u0003 \u0002)",
"at Aspose.Words.Document.\u0002(\u0003 \u0002, SaveOptions \u0003)",
"at Aspose.Words.Document.\u0002(Stream \u0002, String \u0003, SaveOptions \u0005)",
"at OfficeDocToImage.Function.ConvertWordToImages(AmazonS3Client client, GetObjectResponse response, String s3Folder, String s3Bucket, OfficeDocToImageRequest request) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 148",
"at OfficeDocToImage.Function.FunctionHandler(APIGatewayProxyRequest apiRequest, ILambdaContext context) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 72"
],
"cause": {
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.",
"stackTrace": [
"at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, Boolean isOpaque)",
"at \u0002 ..cctor()"
],
"cause": {
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory",
"stackTrace": [
"at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()",
"at SkiaSharp.SKImageInfo..cctor()"
]
}
}
}
]
}