Hey forum members,
My company recently decided to move the apps from IIS to Kubernetes. We had some issues with fonts but we solved. Telerik can render pdf succesfully but we see some shifts on texts and spaces in words get bigger. It renders on IIS on windows server fine, but in docker container, it seems weird a bit. We could not the reason.
I m attaching the screenshots.
Note: all the data in the attached pictures are test data. They are not valid.
What is your suggestions about the cause?
Thanks
Said
1 Answer, 1 is accepted
Hi Said,
Can you elaborate on your environment?
You have specified the Telerik Report Server product in the Ticket Info, and its .NET Framework version can run only on IIS. The .NET 8 version is still in preview and may run on Docker with Linux and on Windows IIS.
In the red Trial message from the Standalone Report Designer screenshot, I see Telerik Reporting version 19. There is no indication of the designer being connected to a Report Server. Do you use Telerik Reporting for building your application that exports PDF documents? If so, do you use the Skia graphics engine (see processing Element) on Linux when deploying on Kubernetes? What is the exact Reporting version on your application? We are aware of issues with Skia, and some of them have already been addressed in our latest releases.
Which fonts does your report use? Did you ensure the correct fonts are deployed on your production environment?
Can you send a runnable report we may use to reproduce the issue locally and investigate?
Regards,
Todor
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Todor, thank you for taking your time to read and answer my question.
The app is net7.0 ASP.NET Core Web API
In this api we use Telerik.Reporting Version=15.2.21.1125, and Telerik.Reporting.WebServiceDataSource Version=15.2.21.1125
To be honest, I dont make changes on designs, I m working on dockerizing this api and deploying to kubernetes.
I downloaded the designer from Telerik's web site to see the content of design.
I just asked to a coworker about designer version, she said the Telerik Report Designer she uses is version 15.2.21.1125, I attached the screenshot of the designer on her computer now.
Our workflow is generally this:
-Product team makes requests for change
-One of the devs who are responsible for design changes makes change, puts into repository
-If no code is changed; then manually puts the changed trdp file into app folder on IIS server
-If code is changed; then publish the api, and put the artifact into app folder on IIS server
Right now we are trying to change this behaivour. After a change merged into repository, a pipeline starts and creates docker image, and then deploy to kubernetes pod with no manual process involved
I m sorry, I dont know what Skia is. Neither does my coworker
The base docker image is:
OS: Alpine Linux v3.19 on Windows 10 x86_64
Kernel: 5.15.167.4-microsoft-standard-WSL2
Packages: 81 (apk)
The fonts are Arial and Times New Roman. I added them with msttcorefonts-installer pkg in dockerfile with `apk` pkg manager.
Before we added, it was throwing exceptions on rendering. But now, it is rendering successfully, but the result is not like we want
I attached the csharp code file and the trdp file. But the forum does not accept the cs and trdp file extensions. I changed cs extension to txt and trdp extension to JPG. You will need to change the file extension in order to open.
Thanks again for your time
Said
Hi Todor, my friend just discovered this behviour happens when you 'justify' the text box with this:
We dont know if this is the only cause. But at least we know this causes the text shift.
fyi
Thanks,
Said
Hello Said,
Skia is a GDI-independent graphics engine that we integrated into Telerik Reporting starting with R3 2023 (17.2.23.1010). It lets you deploy our Reporting tool on Linux and Mac with .NET 7+ as they don't support GDI (System.Drawing) on non-Windows machines - System.Drawing.Common is not supported on non-Windows platforms - .NET 6 and .NET 7 under Linux and MacOS. I cannot explain how your .NET 7 application works on Linux with your current Reporting version.
Did you test with newer Telerik Reporting? We have fixed multiple issues related to PDF rendering that you use based on the code. There are more on the way, for example, Line breaks in HtmlTextBox are not rendered correctly in PDF with some fonts.
In your TRDP report from the file 'design.JPG', I also noticed multiple overlaps indicated by the yellow warning triangles in the Standalone Report Designer. I suggest fixing them as they may lead to unexpected outcomes in some renderings.
I cannot run your report as there are Fields and Parameter values not available on our end. Can you send a minimal runnable report we may use for local investigation?
Good news, I solved my problem. tldr; I moved to debian base img from alpine base img
I m sorry, I m late to answer. I have been busy with some other things. I could not test with newer Telerik Reporting pkg.
I have been struggling to get a trial license. Looks like I m late to use a trial license for this mail address, it is expired. I created another account to get a trial license. But the because I did not install Telerik Reporting with the new account, I cant see any license key for new account. I was gonna try removing and installing again, but I solved my problem. To be honest, all these licensing steps look pretty confusing.
I contacted to the person who implemented telerik reporting back then in our WebApp. She gave me the username and password. But that account can only see 15.2.21.1125 version.
That being said, I have not been able to test with newer Telerik Reporting pkg.
I created a super simple design file. And I created a minimal c# project file including dockerfiles. I attached the project to this msg in case you want to see what my problem was. It contains the trdp file and docker files as well. (Do not forget to update nuget config file with valid credentials if you want to run) When you run on visual studio, you can get pdf without any text shifts. But if you create a docker image with alpine base img by running 'docker build -t demoalpine -f Dockerfile.alpine .' and run on docker, you will get pdf text shifts. I m attaching results, you can see. If you use debian base img by running 'docker build -t demodebian -f Dockerfile.debian .' you will see results are as same as on IIS. (The result is in base64 format, you will need to convert into a file. You can use base64 . guru website.)
Let me tell you one thing. The justifying text is not working at all. Even in Windows IIS. It is behaving just like 'align left'. At least in my case.
About System.Drawing, I think 'libc6-dev' and 'libgdiplus' pkgs are your answer. If I dont install 'libc6-dev' and 'libgdiplus' pkgs in debian or 'libgdiplus' pkg in alpine on building docker img, I get 'Telerik.Reporting.Drawing.Unit threw an exception' when I make a request the endpoint. You can see whole error on attached error-1.txt file. I think this is the issue I was having. Implementation for these pkgs between alpine and debian linux is different somehow.
I wanted to share my experience with the community. Maybe someone benefits.
Thank you again taking your time and answering my questions.
Said Yeter
Hi Said,
Thank you for sharing your findings and attachments with our community.
The attached project references .NET 7 (deprecated) and Telerik Reporting "15.2.21.1125" that doesn't support the Skia Graphics engine:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.19" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Telerik.Reporting" Version="15.2.21.1125" />
</ItemGroup>
<ItemGroup>
<None Update="design.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
The issue should have come from the different implementations of the libgdiplus for the two Linux platforms. This is the System.Drawing implementation for Linux.
In our latest versions, we use Skia as the System.Drawing.Common is not supported on non-Windows platforms - .NET 6 and .NET 7 under Linux and MacOS.
I strongly recommend using the latest Telerik Reporting with the Skia graphics engine on Linux.