Aspose.Slides for .NET - WriteAsSvg Is Not Working on Kubernetes (Linux)

Hi There,

We are are using Aspose.Slides (.Net) with an older version. (23.5). In one of our unit-tests we call the WriteAsSvg(Stream stream, Slides.Export.ISVGOptions svgOptions) method.
While trying to upgrade to the latest version (24.10) or event just one after (23.6), our unit-test failed in CI/CD environment which uses Kubernetes. Here’s the failure:

fail: DRNetService.Controllers.ApiController[0]
#13 147.7 Process SVG - slide 0 message=System.Drawing.Common is not supported on this platform.StackTrace= at System.Drawing.StringFormat.get_GenericTypographic()

I assume that the use of System.Drawings.Utils v7.0.0 created the issue.
Can this function be multiplatform for versions greater than 23.5?

Thanks,

Shlomi

@shlomi.z,
Thank you for contacting free support.

Please note the following:

I hope this information will help you.

More details:
System Requirements|Aspose.Slides Documentation
Aspose.Slides for .NET 6 Cross Platform|Aspose.Slides Documentation

Thanks @andrey.potapov.

I am using latest Aspose.Slides.NET6.CrossPlatform (v24.10) and it works with .net 7.0. Nevertheless when I upgrade to .net 8.0, I get exception on the following line of code:

 _presentation = new Presentation(fileName);

The exception:

Unable to load shared library ‘libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23’ or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace

This exception only pops on Docker (WSL) environment, and not Windows.

Any ideas?

@shlomi.z,
Thank you for the details. I need some time to check the problem. I will get back to you as soon as possible.

@shlomi.z,
Could you please share the simplest project to reproduce the error you described?

Hi @andrey.potapov ,

Attached is a simple .NET 8 web-api project using the Aspose.Slides.NET6.CrossPlatform nuget v 24.10
aspose-web.zip (6.1 KB)

  1. I run it using the ‘Container (DockerFile)’ configuration.
  2. I used postman to call Get Slides/get_slide?path=. But you can also use curl.

The exception is when trying to create a new Presentation.

return new Presentation(fileName, loadOptions);

Keep me posted.

Thanks,
Shlomi

@shlomi.z,
Thank you for the sample project. I need some time to check the problem. I will get back to you soon.

@shlomi.z,
Unfortunately, I could not use the sample project you provided to reproduce the error. I get errors when running the Dockerfile to build a container. Could you please check the project?

What errors did you get?
Did you manage to load the project without the docker?

@shlomi.z,
The first error I get is:

Dockerfile:15
--------------------
  13 |     ARG BUILD_CONFIGURATION=Release
  14 |     WORKDIR /src
  15 | >>> COPY ["aspose-web/aspose-web.csproj", "aspose-web/"]
  16 |     RUN dotnet restore "./aspose-web/aspose-web.csproj"
  17 |     COPY . .
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 26e19418-4295-4415-a743-358d40ce9e6b::nezwiaerrzaq1b5cq0i99vg4h: "/aspose-web/aspose-web.csproj": not found

I tried to fix it like this:

COPY ["aspose-web.csproj", "aspose-web/"]

but I get the following error:

Dockerfile:19
--------------------
  17 |     COPY . .
  18 |     WORKDIR "/src/aspose-web"
  19 | >>> RUN dotnet build "./aspose-web.csproj" -c $BUILD_CONFIGURATION -o /app/build
  20 |
  21 |     # This stage is used to publish the service project to be copied to the final stage
--------------------
ERROR: failed to solve: process "/bin/sh -c dotnet build \"./aspose-web.csproj\" -c $BUILD_CONFIGURATION -o /app/build" did not complete successfully: exit code: 1

Hey @andrey.potapov ,

Let’s do the following:

  1. Create an empty solution.
  2. Create a new ASP .Net core web API project in solution
  3. Set it to .Net 8 and add docker support. See image below:
    image.png (13.7 KB)
  4. Install the latest version of ‘Aspose.Slides.NET6.CrossPlatform’ Nuget.
  5. Copy relevant classes to the project:
    a. SlidesController.cs
    b. PresentationExtensions.cs
    c. LicenseHelper.cs - Not sure if you need it, I am guessing you guys have your own licenses.
  6. Call Get Slides/get_slide?path=[your-pptx-file-path].

Keep me posted.

Thanks,
Shlomi

@shlomi.z,
Thank you for the additional information.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-44752

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.