System.NullReferenceException is thrown at Ubuntu while DOC to PDF conversion


I am using dotnet 2.2 and aspose 19.1.0 lib.
I have the latest skiasharp 1.68.0 and
SkiaSharp.NativeAssets.Linux. (40.4 KB)

When I converting in windows everything is ok.
When I converting in ubuntu (16.04 and 18.04) null reference occours.

Object reference not set to an instance of an object. stack trace at . ( )
at . ( )
at . ( )
at .( )
at .()
at . ​ ()
at ​ ( )
at . ( )
at Aspose.Words.Document.( , SaveOptions )
at Aspose.Words.Document.(Stream , String , SaveOptions )

The document include picture (the document is included in zip file).


Thanks for your inquiry. We are setting up the same environment as of yours and will test the scenario. We will get back to you soon.


Thanks for your patience. We have tested the scenario using the following code example at Ubuntu and have not found the shared issue.

Document doc = new Document(@"sample.dotx");

We suggest you please remove this DLL and install Aspose.Words for .NET through NuGet. Hope this helps you.

If you still face problem, please share the source code without compilation errors that you are using at your end. Please also share the steps to reproduce this issue at our end. We will investigate the issue on our side and provide you more information on it.

Hi thank you for quick answer.
I tested again on clean ubuntu mashine. Everything was ok, pdf was generated.
Then I installed apt install libfontconfig-dev and above error occurs.


Thanks for sharing the detail. We are investigating this issue and will get back to you soon.


Thanks your patience. We have tested the scenario using the latest version of Aspose.Words for .NET 19.1 at Ubuntu 18.04 and have not found the shared issue. We have followed the following steps to test this case:

  1. Create sample application to convert DOTX to PDF in Visual Studio 2017 at Windows 10.
  2. Publish it for Linux operating system.
  3. Run the following command at Ubuntu 19.04
    sudo apt-get install libfontconfig-dev
  4. Run the application at Ubuntu to convert DOTX to PDF.
  5. No exception is thrown. PDF is converted successfully.

Hi me again :slight_smile:

I think I know when error will be thown. If you add to your project below references
PackageReference Include=“SkiaSharp” Version=“1.68.0”
PackageReference Include=“SkiaSharp.NativeAssets.Linux” Version=“1.68.0”

When I removed it, pdf was generated in all cases.


Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18005. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18005) have been fixed in this Aspose.Words for .NET 19.4 update and this Aspose.Words for Java 19.4 update.