Nullpointer exception when deployed to container

We are currently evaluating Aspose.Total for our document generation needs. We have built a sample API using your libraries to generate a PDF document given an HTML template. The API builds and works fine when we run locally. However it fails with a Null Pointer exception when deployed as an API.

The API is built on .NET 5.0 and uses Apsose.PDF v 22.8.0. It’s deployed on a AKS cluster using Linux containers. Our Dockerfile is slightly different from the sample specified at : How to run Aspose.PDF in Docker|Aspose.PDF for .NET

We build our .NET Apps outside on the docker file, however I did include the following to install the fonts in our image.

RUN apt-get update && apt-get install -y libgdiplus

RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list

RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig

Can you please help us resolve this issue? If we cannot get this to work, I’m afraid, we will need to look for alternatives.

Exception :

System.NullReferenceException:

at #=zgsWXFsG0hXmztJeS3_usXUsgFkUbN5JUzwxpIc0=.#=zdJJw8NZNXKH_ (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zgsWXFsG0hXmztJeS3_usXUsgFkUbN5JUzwxpIc0=.#=zdJJw8NZNXKH_ (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zXNejS5ReOAPNkL9AMpEOKNiPy7KD9CBl1Q==.#=z5Yxgrw1Ii_FW (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=z6_yLoUPbLIQSxc3jZvh_QoPut9hSymAsaNvgQsE=…ctor (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zXNejS5ReOAPNkL9AMpEOKNiPy7KD9CBl1Q==…ctor (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zXNejS5ReOAPNkL9AMpEOKNiPy7KD9CBl1Q==…ctor (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zvy0alxJmnHnuP1wAa$VWijvF8cIDTTM1XQ==.#=z_hHSMOaVGuBe (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zvy0alxJmnHnuP1wAa$VWijvF8cIDTTM1XQ==.#=zLAf5Pzw= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=z_9ny_hbjWOk4LXUX7Brvvny3kg75BJt0VA==.#=zJn9dwK67GXnb (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=z_9ny_hbjWOk4LXUX7Brvvny3kg75BJt0VA==.#=zK4C_Qo8= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zeMNlJkoRyf4s3WN2jZHVWxDl_447.#=zK4C_Qo8= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zwwXHW71kBqwo5XmkfKI92kWVY1yC6c0D9Q==.#=zcoA3cF4= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zwwXHW71kBqwo5XmkfKI92kWVY1yC6c0D9Q==.#=z30I43c8= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zL6c1ugNSFCFznkYTfiPINVl80Tgh8R$ZHg==.#=zkelrlHgO$I5i (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zwbmzkmJ3w_aCET7A7x73DbRK6f1L.Render (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zwbmzkmJ3w_aCET7A7x73DbRK6f1L.Render (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zoU0hnsxX1kWw1$XRdCrKsQ8QSI0G.Render (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zoU0hnsxX1kWw1$XRdCrKsQ8QSI0G.Render (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zF1pbStSeUULiZw70B2BnNRFI8Z9I.#=zzCpBwR6rV2$B (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zF1pbStSeUULiZw70B2BnNRFI8Z9I.#=zIy49nFs= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at #=zF1pbStSeUULiZw70B2BnNRFI8Z9I.#=zIy49nFs= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at Aspose.Pdf.Document.#=zXbhW0k4= (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at Aspose.Pdf.Document…ctor (Aspose.PDF, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

@satishkrishna.pilla

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input document.
  • Please create a Visual Studio docker application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.