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

Free Support Forum - aspose.com

Aspose.Pdf Docuemnt save throw exception under MacOS & Ubuntu

Hi,
I tried to use Aspose.Pdf (19.11.0) to modify any PDF under both MacOS 10.15.1 and Ubuntu 16.4, then after called Document.Save(MyFileName), I always get exception as below. How can I do?

Environment

  1. Viusal-Studio 2019 Community
  2. DotNet Core 2.1
  3. C#

Exception, Message=Object reference not set to an instance of an object., StackStrace= at #=zXXglXw1z_gkRSct2ztj91$R38Haz.#=zGxEi6YM=(#=z3R_57fiUj5ViWvx$9zCfgDMWKWNe #=zHmbHegVUNRfS)
at #=zEr3UXn5C4peIkjm$utGDyzw=.#=zIn7YGNU=(#=z3R_57fiUj5ViWvx$9zCfgDMWKWNe #=zHmbHegVUNRfS)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zRfIRtKvtL3AtcNTOVWqg3PaBBx5B4CIjo$Y_FkZzyN6p(Object #=zVs8g$x4=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zFkVLFCzX3hMEv4ol9tZsl_E=(MethodBase #=zVs8g$x4=, Boolean #=zZzkXk34=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=z2b$JCDCZlEUHyiBqys0NDQO1_wImukXFNw==(#=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY= #=zVs8g$x4=, #=qQN1t3z32_K$OirmeV1NRU6WDnt0EvkeUtUAGt4p9aUc= #=zZzkXk34=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=z4mkRGyR9WPyR4RWKO4KKIgHEjAslzEtHcSH_ys8=()
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zJK7trpMWDIevM7ah9$iNwFqV2$YSG$k0R0YLzuA=(Bo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7ah9$iNwFqV2$YSG$k0R0YLzuA=(Boolean #=zVs8g$x4=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zJK7trpMWDIevM7ah9$iNwFqV2$YSG$k0R0YLzuA=(Boolean #=zVs8g$x4=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zHu6SvYEXKG3Rvf_uCY$ueKA=()
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zOIweOSmHkPneluXZkrm1FTgBp9Y7(Object[] #=zVs8g$x4=, Type[] #=zZzkXk34=, Type[] #=zi1GiR9c=, Object[] #=zrJqHYFc=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=z3jJeV8ATKtD0vgCBg0eFcYU=(Stream #=zVs8g$x4=, String #=zZzkXk34=, Object[] #=zi1GiR9c=, Type[] #=zrJqHYFc=, Type[] #=zFmgN7Fs=, Object[] #=zXJ8uWFA=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zicEewu10F7TdZZE8QjPc$9PPc9SM(Stream #=zVs8g$x4=, String #=zZzkXk34=, Object[] #=zi1GiR9c=)
at #=qojoxXVzDdkZ0E9MYCZn7Tm4oB5vG9gfq0Q5QOa9G3wY=.#=zqxGy9XVVCb5QYGtXE80Ghgs=(Stream #=zVs8g$x4=, String #=zZzkXk34=, Object[] #=zi1GiR9c=)
at Aspose.Pdf.Document.#=z4xtefH5At4Q7(Stream #=zZ91Gt8c=, SaveOptions #=z5X7wjmJaUFMm)
at Aspose.Pdf.Document.#=zEf57q6V1seTN(String #=zNo3Cfw2oI6lO)
at Aspose.Pdf.Document.Save(String outputFileName)
at TestConsole.AppCode.PdfHelper.Test(String fileName)

@Eric1973

Thank you for contacting support.

Please ensure that MS Core fonts and libgdiplus package is installed in your environment or reinstall it if already installed. There are not any environment specific limitations of the API so we are hopeful your problem will probably be resolved as well.

Hi,
I had installed libgdiplus on Mac and Ubuntu, it works fine with another System.Drawing applications. How many MS Core fonts should I install?

@Eric1973

On Ubuntu, you may try to find and install the ttf-mscorefonts-installer package from Synaptic Package Manager. Or below approaches may help:

  1. Copy font files (.TTF and .TTC) from a Windows machine to your Linux machine.
  2. Install a TrueType fonts package, such as msttcorefonts.

Please also try to install Aspose.PDF for .NET 19.12 from NuGet gallery.

Hi,
Thanks for your advice. It works on Ubuntu 16.4 with ttf-mscorefonts-installer package, but how about Mac OS? I use the version 19.12 of Aspose.PDF for .NET from Nuget.

@Eric1973

Would you please confirm that every suggested package is installed in Mac OS at your side and if yes, are you facing similar exception there that you have shared in your first post?