DOC to PDF conversion in a linux docker image

Hi,

we are trying to use DocIO and Syncfusion.DocIORenderer.Net.Core to convert a word document to a PDF.

Our development environment is a Windows 10 machine and our production environment a Linux docker image. 

We know that for a Linux environment we need to install the package SkiaSharp.NativeAssets.Linux (as written here  NuGet Packages Required | Syncfusion)


On the windows machine, all is fine. Running the docker image we receive an error:


DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies


Do we need to add some other configurations to run the application on Linux?


Thanks.


 


4 Replies

MZ maurizio ziraldo July 15, 2021 11:20 AM UTC

I've found the solution to this problem. I hope can be useful for others.


SkiaSharp.NativeAssets.Linux needs a specific library installed on Linux: libfontconfig1.

You just need to add the following line to the Dockerfile:


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




LB Lokesh Baskar Syncfusion Team July 15, 2021 12:05 PM UTC

Hi Maurizio,

Thank you for your update.

We are glad to know that you have found and resolved the problem.

Please let us know if you have any other questions and we will be happy to assist you as always.

Please refer the below link for more details.
https://help.syncfusion.com/file-formats/docio/word-to-pdf#word-to-pdf-conversion-in-linux-os  
https://help.syncfusion.com/file-formats/docio/faq#how-to-resolve-libskiasharp-not-found-exception  

Regards,
Lokesh B



TA Tan Akpek replied to maurizio ziraldo December 24, 2024 12:39 PM UTC

This does prevent the runtime errors but I still seem to be losing a lot of features regarding the fonts such as the actual fonts and bullets are also missing.

I've tries both of these approaches

https://github.com/mono/SkiaSharp/issues/1312

https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies/


Has anyone managed to get it working with a linux container without losing these functionalities?



SA Sivakumar Alagusundharam Syncfusion Team December 26, 2024 04:15 PM UTC

Hi Tan,

The reason for the problem is that the required fonts are not available in the Docker Linux environment. Kindly ensure that the necessary fonts used in the Word document are installed in your environment. You can check for missing fonts using the font substitution event.

To resolve the problem, please install the necessary fonts used in the Word document by referring to the documentation below:

FAQ about using DocIO in Linux | DocIO | Syncfusion®

Refer the below documentation to resolve the font preservation issues

How to resolve font problems during Word to PDF or image conversion?


Regards,
Sivakumar. A



Loader.
Up arrow icon