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

Free Support Forum - aspose.com

Converting doc to pdf and getting Skiasharp error

Hi, I am trying to convert a document to pdf and it is working fine locally. However, when I am trying to run this in a docker container(Ubuntu 18.04), it is giving an error:

Unhandled exception. System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKObject’ threw an exception.
—> System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKColorSpace’ threw an exception.
—> System.DllNotFoundException: 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
at SkiaSharp.SkiaApi.sk_colorspace_new_srgb()
at SkiaSharp.SKColorSpace…cctor()
— End of inner exception stack trace —
at SkiaSharp.SKColorSpace.EnsureStaticInstanceAreInitialized()
at SkiaSharp.SKObject…cctor()
— End of inner exception stack trace —
at SkiaSharp.SKObject.DeregisterHandle(IntPtr handle, SKObject instance)
at SkiaSharp.SKObject.set_Handle(IntPtr value)
at SkiaSharp.SKNativeObject.Dispose(Boolean disposing)
at SkiaSharp.SKNativeObject.Finalize()

I am using Aspose.Words version 20.5.0.0.
What can be the exact root of error and why it’s only coming in docker?

@shiva14

Aspose.Words for .NET Standard uses SkiaSharp to deal with graphics. To make it work on Linux you should also add Nuget reference to SkiaSharp.NativeAssets.Linux.NoDependencies.

We suggest you please read about SkiaSharp dependency from here: