Converting Docx using Aspose in AKS

Hi All,

I am trying to convert docx file into pdf inside an AKS container and got the following error.

 Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKObject' threw an exception.
 System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 

I have tried to follow suggestion inside Aspose Forum by executing apt-get update && apt-get install -y libfontconfig1 and still have the same error. Any suggestions? Thanks!

extra details:
.net 8.0, aspose pdf.

<PackageReference Include="Aspose.Words" Version="24.3.0" />
<PackageReference Include="Aspose.PDF.Drawing" Version="24.3.0" />

@tinbird Aspose.Words for .NET Standard and .NET Core use SkiaSharp to deal with graphics, to make it work on Linux you have to add reference either to SkiaSharp.NativeAssets.Linux or to SkiaSharp.NativeAssets.Linux.NoDependencies

If you add reference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1 in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:

apt-get update && apt-get install -y libfontconfig1

If you do not have rights to install packages, or other reasons not to install libfontconfig1, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies , which does not require installation of libfontconfig1.

1 Like