Running telerik reporting pdf generation in docker linux container

Viewed 202

I have a report that is designed using telerik reporting library and .net core 3.1. I have to generate pdf file for it using following code:

var reportProcessor = new ReportProcessor();
var report = new Report1();
var reportSource = new InstanceReportSource()
            {
                ReportDocument = report,
            };
var deviceInfo = new System.Collections.Hashtable{ { "FontEmbedding", "Full" } };
var result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);

everything work fine when running on windows. but when running on docker linux container the generated pdf will have no text at all I tried to install fonts and required libraries in container by following command

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig
RUN apt-get update \ 
    && apt-get install -y --allow-unauthenticated \ 
        libc6-dev \ 
        libgdiplus \ 
        libx11-dev \ 
    && rm -rf /var/lib/apt/lists/*

but the problem still not fixed, see the following snippet

this is sample generated pdf in linux container

what am I missing?

0 Answers
Related