|
| 1 | +--- |
| 2 | +title: FAQ about using XlsIO in Linux | Syncfusion |
| 3 | +description: This page explains about the frequently asked questions about using the .NET Excel (XlsIO) library in Linux environment. |
| 4 | +platform: document-processing |
| 5 | +control: XlsIO |
| 6 | +documentation: UG |
| 7 | +--- |
| 8 | + |
| 9 | +# Frequently asked questions about using XlsIO in Linux |
| 10 | + |
| 11 | +The frequently asked questions about using XlsIO in Linux environment are listed below. |
| 12 | + |
| 13 | +## How to copy necessary fonts to Linux containers? |
| 14 | + |
| 15 | +Excel to PDF conversion on Linux relies on system fonts available inside the container. By default, only a limited set is installed. Copy the required fonts to "/usr/local/share/fonts/" and refresh the font cache so they are used during conversion. Refer to the steps below to copy fonts. |
| 16 | + |
| 17 | +**Steps:** |
| 18 | + |
| 19 | +Step 1: Create a **Fonts** folder inside your project (or next to the solution). |
| 20 | +Step 2: Place the required TrueType/OpenType font files (.ttf/.otf) in that folder. |
| 21 | +Step 3: Add the following to your Dockerfile to install font support, copy fonts, and refresh the cache. |
| 22 | + |
| 23 | +{% tabs %} |
| 24 | + |
| 25 | +{% highlight Dockerfile %} |
| 26 | + |
| 27 | +# Install native font support |
| 28 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 29 | + fontconfig \ |
| 30 | + libfreetype6 \ |
| 31 | + libpng16-16 \ |
| 32 | + libexpat1 \ |
| 33 | + libuuid1 \ |
| 34 | + && rm -rf /var/lib/apt/lists/* |
| 35 | + |
| 36 | +# Copy fonts from your project into the container |
| 37 | +COPY ["ProjectName/Fonts/*.*", "/usr/local/share/fonts/"] |
| 38 | + |
| 39 | +# Refresh the font cache so the new fonts are recognized |
| 40 | +RUN fc-cache -f -v |
| 41 | + |
| 42 | +{% endhighlight %} |
| 43 | + |
| 44 | +{% endtabs %} |
| 45 | + |
| 46 | +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Linux/Copy%20fonts%20to%20linux%20containers/.NET/Copy_fonts_to_linux_containers). |
| 47 | + |
| 48 | +## How to set culture/locale in Docker containers (Windows and Linux)? |
| 49 | + |
| 50 | +By default, Culture/Locale that is specified in the container image will be used in Docker containers. |
| 51 | + |
| 52 | +If you want to change or set Culture/Locale in the Docker container, set the required Culture/Locale in Docker file. |
| 53 | + |
| 54 | +T> We recommend you check whether the required Culture/Locale is set to the Docker containers since some Docker container may not have Culture/Locale. |
| 55 | + |
| 56 | +The following code example will set en_US locale to the container by setting Language to en_US. |
| 57 | + |
| 58 | +{% tabs %} |
| 59 | + |
| 60 | +{% highlight Dockerfile %} |
| 61 | +ENV LANG="en_US.UTF-8" |
| 62 | +{% endhighlight %} |
| 63 | + |
| 64 | +{% endtabs %} |
| 65 | + |
| 66 | +## How to resolve LibSkiaSharp not found exception? |
| 67 | + |
| 68 | +This exception occurs when required native dependencies are missing. Ensure the necessary packages are installed by adding this to your Docker file: |
| 69 | + |
| 70 | +{% tabs %} |
| 71 | + |
| 72 | +{% highlight Dockerfile %} |
| 73 | +RUN apt-get update -y && apt-get install libfontconfig -y |
| 74 | +{% endhighlight %} |
| 75 | + |
| 76 | +{% endtabs %} |
| 77 | + |
| 78 | +In production environment (hosted server machine), ensure whether the Visual C++ Redistributable is properly installed. |
| 79 | + |
| 80 | +[Download](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) and install Visual C++, if not installed. |
0 commit comments