Skip to content

Commit 3166db9

Browse files
Merge pull request #1784 from Syncfusion-Content/hotfix/hotfix-v31.2.2
DOCINFRA-2341_merged_using_automation
2 parents 18debf6 + 5ffc713 commit 3166db9

File tree

3 files changed

+173
-0
lines changed

3 files changed

+173
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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/" before 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 copy the fonts to the container.
22+
23+
{% tabs %}
24+
25+
{% highlight Dockerfile %}
26+
27+
COPY ["ProjectName/Fonts/*.*", "/usr/local/share/fonts/"]
28+
29+
{% endhighlight %}
30+
31+
{% endtabs %}
32+
33+
You can download a complete working sample from <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Linux/Copy%20fonts%20to%20linux%20containers/.NET/Copy_fonts_to_linux_containers">GitHub</a>.
34+
35+
## How to install Microsoft compatible fonts on Linux?
36+
37+
By default, Linux systems include a limited set of fonts located at "/usr/share/fonts/". For document conversion scenarios that require Microsoft-compatible fonts, you can install them using the following command:
38+
39+
{% tabs %}
40+
41+
{% highlight Kconfig %}
42+
sudo apt-get install ttf-mscorefonts-installer
43+
{% endhighlight %}
44+
45+
{% endtabs %}
46+
47+
After installation, the fonts will be available at "/usr/share/fonts/truetype/msttcorefonts", and will be used during conversion.
48+
49+
N> Ensure you have obtained the appropriate license clearance from Microsoft before using these fonts in your environment.
50+
51+
## How to install necessary fonts in Linux containers?
52+
53+
In Excel to PDF conversion, Essential<sup>&reg;</sup> XlsIO uses the fonts installed in the production environment to measure and render text. If a required font is missing, an alternate font will be used based on the environment, which may affect layout fidelity.
54+
55+
To ensure proper font preservation, install all fonts used in the Excel document within the container.
56+
57+
Use the following code snippet to install fonts in containers.
58+
59+
{% tabs %}
60+
61+
{% highlight Dockerfile %}
62+
RUN apt-get update -y && \
63+
apt-get install -y fontconfig debconf && \
64+
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections && \
65+
apt-get install -y \
66+
fonts-arphic-ukai \
67+
fonts-arphic-uming \
68+
fonts-ipafont-mincho \
69+
fonts-ipafont-gothic \
70+
fonts-unfonts-core \
71+
ttf-wqy-zenhei \
72+
ttf-mscorefonts-installer && \
73+
fc-cache -fv && \
74+
apt-get clean && \
75+
apt-get autoremove -y && \
76+
rm -rf /var/lib/apt/lists/*
77+
{% endhighlight %}
78+
79+
{% endtabs %}
80+
81+
If font preservation issues persist after installing the required packages, you can manually copy the necessary font files into the container.
82+
83+
## How to set culture/locale in Docker containers (Windows and Linux)?
84+
85+
By default, Culture/Locale that is specified in the container image will be used in Docker containers.
86+
87+
If you want to change or set Culture/Locale in the Docker container, set the required Culture/Locale in Docker file.
88+
89+
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.
90+
91+
The following code example will set en_US locale to the container by setting Language to en_US.
92+
93+
{% tabs %}
94+
95+
{% highlight Dockerfile %}
96+
ENV LANG="en_US.UTF-8"
97+
{% endhighlight %}
98+
99+
{% endtabs %}
100+
101+
## How to resolve LibSkiaSharp not found exception?
102+
103+
This exception occurs when required native dependencies are missing. Ensure the necessary packages are installed by adding this to your Docker file:
104+
105+
{% tabs %}
106+
107+
{% highlight Dockerfile %}
108+
RUN apt-get update -y && apt-get install libfontconfig -y
109+
{% endhighlight %}
110+
111+
{% endtabs %}
112+
113+
In production environment (hosted server machine), ensure whether the Visual C++ Redistributable is properly installed.
114+
115+
[Download](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) and install Visual C++, if not installed.

Document-Processing/Excel/Excel-Library/NET/Working-with-Data-Validation.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,58 @@ Using excelEngine As ExcelEngine = New ExcelEngine()
540540
End Using
541541
{% endhighlight %}
542542
{% endtabs %}
543+
544+
## Remove Data Validation
545+
546+
The following code snippet illustrates how to remove data validation rules from a worksheet.
547+
548+
{% tabs %}
549+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/Data%20Validation/Remove%20Validation/.NET/Remove%20Validation/Remove%20Validation/Program.cs,180" %}
550+
using (ExcelEngine excelEngine = new ExcelEngine())
551+
{
552+
IApplication application = excelEngine.Excel;
553+
application.DefaultVersion = ExcelVersion.Xlsx;
554+
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
555+
IWorksheet worksheet = workbook.Worksheets[0];
556+
557+
//Removing data validation from the worksheet
558+
worksheet.UsedRange.Clear(ExcelClearOptions.ClearDataValidations);
559+
560+
//Saving the workbook
561+
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
562+
}
563+
{% endhighlight %}
564+
565+
{% highlight c# tabtitle="C# [Windows-specific]" %}
566+
using (ExcelEngine excelEngine = new ExcelEngine())
567+
{
568+
IApplication application = excelEngine.Excel;
569+
application.DefaultVersion = ExcelVersion.Xlsx;
570+
IWorkbook workbook = application.Workbooks.Open("InputTemplate.xlsx");
571+
IWorksheet worksheet = workbook.Worksheets[0];
572+
573+
//Removing data validation from the worksheet
574+
worksheet.UsedRange.Clear(ExcelClearOptions.ClearDataValidations);
575+
576+
//Saving the workbook
577+
workbook.SaveAs("Output.xlsx");
578+
}
579+
{% endhighlight %}
580+
581+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
582+
Using excelEngine As ExcelEngine = New ExcelEngine()
583+
Dim application As IApplication = excelEngine.Excel
584+
application.DefaultVersion = ExcelVersion.Xlsx
585+
Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xlsx")
586+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
587+
588+
'Removing data validation from the worksheet
589+
worksheet.UsedRange.Clear(ExcelClearOptions.ClearDataValidations)
590+
591+
'Saving the workbook
592+
workbook.SaveAs("Output.xlsx")
593+
End Using
594+
{% endhighlight %}
595+
{% endtabs %}
596+
597+
A complete working example to remove validations from a worksheet in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Data%20Validation/Remove%20Validation/.NET/Remove%20Validation">this GitHub page</a>.

Document-Processing/Word/Word-Library/NET/Working-with-Fields.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Find more information about migration changes [here](https://help.syncfusion.com
2727

2828
N> The document may contain `IncludePicture` fields. These fields are designed to dynamically insert images by referencing external URLs. Each time such a field is encountered, the corresponding image is downloaded from the specified URL. This process significantly increases the time required to process and save the document. We recommend replacing these dynamic `IncludePicture` fields with standard image insertions. This approach eliminates the need for repeated external image downloads and allows the document to be saved in minimal time, ensuring optimal performance.
2929

30+
To quickly start working with Fields, please check out this video:
31+
{% youtube "https://www.youtube.com/watch?v=MSGoiKXd7Xo" %}
32+
3033
## Adding fields
3134

3235
You can add a field to a Word document by using the [AppendField](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WParagraph.html#Syncfusion_DocIO_DLS_WParagraph_AppendField_System_String_Syncfusion_DocIO_FieldType_) method of [WParagraph](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WParagraph.html) class.

0 commit comments

Comments
 (0)