Conversion from FlatOpc to HTML fails on Linux

I am trying to convert my docx file to FlatOpc and then using same FlatOpc file to convert to html. It fails if docx file have images or shape. It fails only on Linux platform (using Ubuntu), Conversion throws following exception:

System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module or one of its dependencies could not be found.
(Exception from HRESULT: 0x8007007E)
  at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
  at SkiaSharp.SKImageInfo..cctor()

I have attached zip file of sample code and test data. While investigation you need to add licence. I removed my licence from code.Aspose-Image-Issue.zip (264.7 KB)

@gkukko,

Thanks for your inquiry. This is kind of limitation of SkiaSharp that is used by Aspose.Words .NET Standard version. SkiaSharp NuGet package does not contain native skia library for Linux, so it is required to add it manually.

  1. Create ne .NET Core Console Application
  2. Please install Aspose.Words for .NET through NuGet.
  3. Aspose.Words for .NET Standard uses SkiaSharp, which does not have native Skia library for Linux in its NuGet package yet. However, it is not a problem, because this native library is published with every SkiaSharp release on Github. Please note that Aspose.Words uses SkiaSharp 1.60.1, so download libHarfBuzzSharp.so file for this version. Once you download it, add it in your project and set “Copy to output directory”.
  4. Write code that uses Aspose.Words.
  5. Than open cmd line in folder where project file is and run this command:
  6. dotnet publish -r ubuntu.16.04-x64

    dotnet publish -r ubuntu.16.04-x64

  • Copy output ubuntu build folder to Ubuntu
  • Installing .NET Core 2.0 on Ubuntu (https://github.com/dotnet/docs/blob/master/docs/core/linux-prerequisites.md)
  • Open Ubuntu machine terminal (CLI) and Go to the project directory
  • Provide execute permissions:

    chmod 777 ./appname