Based on your example Create Word (DOCX) or PDF in Docker container I am trying to add an image from a remote source likeso
document.Content.End.InsertRange(new Picture(document, "https://picsum.photos/200/300", isLink: true).Content);
yet I get an error (see below). I found that changing from
SkiaSharp.NativeAssets.Linux
to
SkiaSharp.NativeAssets.Linux.NoDependencies
will solve the problem, but I am not experienced enough with Linux to determine whether that’s a good solution or whether it could have undesirable consequences. I also tried
RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev
in the dockerfile, which mitigated the error but lead to images often being shown faulty (also shown below)
I set up a minimal example: GitHub - sdw-ps/gembox-docker: minimal project to demonstrate problems with remote images
I tried this fix for version 35.0.1443, it will not work with 33.x
Error:
System.InvalidOperationException: 'Bitmap decoding failed. 'WPF' (https://docs.microsoft.com/en-us/dotnet/desktop/wpf/) was not found on the system. If the platform on which the application is running supports 'WPF', make sure that your project uses it. 'System.Drawing' (https://docs.microsoft.com/en-us/dotnet/api/system.drawing) was not found on the system. If the platform on which the application is running supports 'System.Drawing', make sure that your project uses it. 'SkiaSharp' threw an exception of type 'System.TypeInitializationException' and with message 'The type initializer for 'SkiaSharp.SKData' threw an exception.'. For more details about the exception, see the inner exception. 'ImageSharp' (https://github.com/SixLabors/ImageSharp/) was not found on the system. If the platform on which the application is running supports 'ImageSharp', make sure that your project uses it. 'GemBox' threw an exception of type 'System.NotSupportedException' and with message 'Specified method is not supported.'.'
Inner Exceptions:
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:
libfontconfig.so.1: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/libSkiaSharp.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/libSkiaSharp.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/runtimes/linux-x64/native/liblibSkiaSharp.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/liblibSkiaSharp.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/liblibSkiaSharp.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/runtimes/linux-x64/native/libSkiaSharp: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/libSkiaSharp: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/libSkiaSharp: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/runtimes/linux-x64/native/liblibSkiaSharp: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/liblibSkiaSharp: cannot open shared object file: No such file or directory
/app/bin/Debug/net7.0/liblibSkiaSharp: cannot open shared object file: No such file or directory