Image not rendered correctly in PDF conversion on Linux with Docker


we run Aspose.Cells inside a Linux Docker container and noticed an issue with an image which is not rendered correctly in a PDF created by Aspose.
2024-07-11_08-44-14.png (99.5 KB)

// See for more information

using Aspose.Cells;

Console.WriteLine("Hello, World!");

var lic = new License();

var wb = new Workbook(@"./workspace/example.xlsx");
wb.Save(@"./workspace/out.pdf", SaveFormat.Pdf);

Project is configured as Net 7 and SkiaSharp.NativeAssets.Linux is installed through nuget as well.

<Project Sdk="Microsoft.NET.Sdk">


    <PackageReference Include="Aspose.Cells" Version="24.6.0" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
    <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.8" />


Dockerfile for reproduction:

#See to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM AS base

FROM AS build
COPY ["ConsoleApp6/ConsoleApp6.csproj", "ConsoleApp6/"]
RUN dotnet restore "./ConsoleApp6/ConsoleApp6.csproj"
COPY . .
WORKDIR "/src/ConsoleApp6"
RUN dotnet build "./ConsoleApp6.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
RUN dotnet publish "./ConsoleApp6.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final

#Include contrib archive to install windows fonts. Must run before package update
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list

#Installs "windows fonts"
RUN apt-get update && apt-get install -y ttf-mscorefonts-installer fontconfig

#Install required packages, see example at
RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev

#SkiaSharp dependency of Aspose Cells requires libfontconfig1. See Aspose documentation for this. 
RUN apt-get update && apt-get install -y libfontconfig1

#ICU for Culture Information
RUN apt-get update && apt-get install -y libicu-dev

COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ConsoleApp6.dll"]

compose example

    image: consoleapp6:latest
      - ./workspace:/app/workspace/
    restart: no

Sample input and output file: (10.1 KB)

By testing on the latest version v24.6 using sample file, we can reproduce the issue. Found that the image is not rendered correctly in pdf conversion on linux with Docker.

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): CELLSNET-56189

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.