Skip to content

Commit 8289427

Browse files
author
Website Automation
committed
Merge remote-tracking branch 'remotes/origin/Resolve-2026-vol1-Main-release-dev-to-master-branch-merging-conflicts'
2 parents cd55d77 + 42c2bff commit 8289427

519 files changed

Lines changed: 18150 additions & 7796 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Document-Processing-toc.html

Lines changed: 238 additions & 87 deletions
Large diffs are not rendered by default.
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
title: Syncfusion font handling in Office-to-PDF and image conversions
3+
description: Learn how Syncfusion Document Processing handles font management during Office to PDF/Image conversions and PDF processing workflows.
4+
platform: document-processing
5+
documentation: UG
6+
---
7+
8+
# Font Manager for Office-to-PDF/Image and PDF Processing
9+
10+
## Overview
11+
12+
Font creation is a primary cause of excessive memory consumption and performance degradation during Office to PDF/Image conversions and PDF processing workflows. This problem is particularly pronounced in multi-threaded web applications where multiple users perform concurrent operations across different threads or browser tabs.
13+
14+
To address this challenge, Syncfusion Document Processing libraries introduce the **FontManager** class, which provides centralized font management shared across all threads and conversion libraries. This approach eliminates duplicate font objects and significantly reduces memory overhead.
15+
16+
## Key Features
17+
18+
* **Shared font caching:** Stores fonts in a unified cache to prevent repeated loading across operations.
19+
* **Memory reduction:** Eliminates duplicate font objects, reducing memory usage during large-scale or parallel document conversions.
20+
* **Performance optimization:** Enables multiple threads to safely reuse the same font instances, improving processing speed.
21+
* **Automatic cleanup:** Automatically disposes unused fonts after a configurable delay (FontManager.Delay) to maintain efficiency in long-running applications.
22+
* **Manual cache management:** Provides FontManager.ClearCache() to immediately clear all cached fonts when needed (e.g., during server shutdown).
23+
24+
## Supported Conversions and Workflows
25+
26+
FontManager optimizes memory usage across the following Office to PDF/Image conversions and PDF processing scenarios:
27+
28+
<table>
29+
<tr>
30+
<th>Category</th>
31+
<th>Details</th>
32+
</tr>
33+
<tr>
34+
<td><b>Office Document Conversions</b></td>
35+
<td>
36+
<b>Word Library (DocIO)</b>
37+
<ul>
38+
<li>Word to PDF conversion.</li>
39+
<li>Word to Image conversion.</li>
40+
</ul>
41+
<b>Excel Library (XlsIO)</b>
42+
<ul>
43+
<li>Excel to PDF conversion.</li>
44+
<li>Excel to Image conversion.</li>
45+
</ul>
46+
<b>PowerPoint Library (Presentation)</b>
47+
<ul>
48+
<li>PowerPoint to PDF conversion.</li>
49+
<li>PowerPoint to Image conversion.</li>
50+
</ul>
51+
</td>
52+
</tr>
53+
<tr>
54+
<td><b>PDF Processing Workflows</b></td>
55+
<td>
56+
<b>PDF Library Operations</b>
57+
<ul>
58+
<li>PDF creation and manipulation</li>
59+
<li>PDF merging and splitting</li>
60+
<li>PDF form filling and flattening</li>
61+
<li>PDF page extraction and insertion</li>
62+
<li>Adding text, images, and annotations to PDF</li>
63+
<li>PDF redaction and security</li>
64+
<li>PDF/A conformance</li>
65+
<li>OCR text extraction</li>
66+
</ul>
67+
</td>
68+
</tr>
69+
</table>
70+
71+
N> FontManager automatically manages fonts across all these conversion types, whether you're processing a single document or handling thousands of concurrent conversions in a multi-threaded environment.
72+
73+
## Configuring Automatic Font Cleanup
74+
75+
The `FontManager.Delay` property defines the duration (in milliseconds) after which unused font objects are automatically disposed and removed from the cache. When fonts are no longer referenced, an internal `System.Timers.Timer` triggers disposal based on this value.
76+
77+
**Default value:** 30,000 milliseconds (30 seconds),
78+
**Valid range:** 1 to 2,147,483,647 milliseconds.
79+
80+
N> This configuration is optional. By default, unused fonts are automatically cleaned up 30 seconds after their references are released. To customize the delay, set this property at the application startup (e.g., in `Startup.cs` or `Program.cs`).
81+
82+
The following example demonstrates how to configure `FontManager.Delay` to automatically release cached fonts after the specified delay during document conversions.
83+
84+
{% tabs %}
85+
{% highlight C# %}
86+
87+
using Syncfusion.Drawing.Fonts;
88+
89+
// Set disposal delay to 50 seconds
90+
FontManager.Delay = 50000;
91+
92+
{% endhighlight %}
93+
{% endtabs %}
94+
95+
The following example demonstrates how to configure `FontManager.Delay` in an **ASP.NET Core application** to ensure cached fonts are automatically released after the specified delay during document conversions.
96+
97+
{% tabs %}
98+
99+
{% highlight C# %}
100+
101+
var builder = WebApplication.CreateBuilder(args);
102+
103+
// Add services to the container
104+
// ...existing code...
105+
106+
var app = builder.Build();
107+
108+
// Configure FontManager to dispose unused fonts after 50 seconds
109+
// Default: 30000ms | Valid range: 1 to 2,147,483,647 milliseconds
110+
Syncfusion.Drawing.Fonts.FontManager.Delay = 50000;
111+
112+
// Configure middleware
113+
// ...existing code...
114+
115+
app.Run();
116+
117+
{% endhighlight %}
118+
119+
{% endtabs %}
120+
121+
## Immediate Font Cache Cleanup
122+
123+
The `FontManager.ClearCache()` method immediately clears all font caches managed by the FontManager. This method forcefully removes and disposes all font instances maintained in shared caches, allowing you to reclaim memory deterministically without waiting for the automatic cleanup delay.
124+
125+
**Use cases:**
126+
127+
* Application shutdown.
128+
* After completing batch conversions.
129+
* Before maintenance operations.
130+
* When immediate memory reclamation is required.
131+
132+
The following example demonstrates how to immediately clear all cached fonts using `FontManager.ClearCache()`.
133+
134+
{% tabs %}
135+
{% highlight C# %}
136+
137+
using Syncfusion.Drawing.Fonts;
138+
139+
// Immediately clear all cached fonts
140+
FontManager.ClearCache();
141+
142+
{% endhighlight %}
143+
{% endtabs %}
144+
145+
The following example demonstrates how to configure `FontManager.ClearCache()` in an **ASP.NET Core application** to clear cached fonts during application shutdown.
146+
147+
{% tabs %}
148+
{% highlight C# %}
149+
150+
// Configure services and middleware
151+
// ...existing code...
152+
153+
// Access the application lifetime service
154+
var lifetime = app.Services.GetRequiredService<IHostApplicationLifetime>();
155+
156+
// Register a callback to clear font cache during application shutdown
157+
lifetime.ApplicationStopping.Register(() =>
158+
{
159+
Syncfusion.Drawing.Fonts.FontManager.ClearCache();
160+
});
161+
162+
// Start the application
163+
app.Run();
164+
165+
{% endhighlight %}
166+
{% endtabs %}
167+
168+
## Best Practices
169+
170+
1. Set FontManager.Delay early: Configure the delay property in your application's startup code before any document processing begins (Optional).
171+
172+
2. Use ClearCache() during shutdown: Register a shutdown handler to clear the cache when your application stops to ensure clean resource cleanup.
173+
174+
3. Consider your workload:
175+
176+
a. For high-frequency, short-lived conversions: Use a shorter delay (e.g., 15-30 seconds).
177+
178+
b. For batch processing with longer intervals: Use a longer delay (e.g., 60+ seconds).
179+
180+
4. Monitor memory usage: Track your application's memory consumption to fine-tune the delay value for optimal performance.
181+
182+
## FAQ
183+
184+
**Q: Do I need to configure FontManager for my application?**
185+
186+
A: No, it's optional. The default 30-second cleanup delay works well for most scenarios. Configure it only if you need custom behavior.
187+
188+
**Q: When should I call ClearCache() manually?**
189+
190+
A: Call it during application shutdown, after batch processing, or when you need immediate memory reclamation rather than waiting for automatic cleanup.
191+
192+
**Q: Is FontManager thread-safe?**
193+
194+
A: Yes, FontManager is designed for multi-threaded environments and allows safe font reuse across multiple threads.
195+
196+
**Q: Will FontManager affect my existing document processing code?**
197+
198+
A: No, FontManager works transparently in the background. Your existing code will automatically benefit from improved memory management without modifications.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Assemblies required for SmartDataExtractor | Syncfusion
3+
description: This section details the Syncfusion assemblies required to configure and run Smart Data Extractor seamlessly in .NET projects.
4+
platform: document-processing
5+
control: SmartDataExtractor
6+
documentation: UG
7+
keywords: Assemblies
8+
---
9+
# Assemblies Required to work with Smart Data Extractor
10+
11+
The following assemblies need to be referenced in your application based on the platform.
12+
<table>
13+
<thead>
14+
<tr>
15+
<th>Platform(s)</th>
16+
<th>Assembly</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tr>
21+
<td>
22+
{{'WPF'| markdownify }},
23+
{{'Windows Forms'| markdownify }} and {{'ASP.NET MVC'| markdownify }}
24+
</td>
25+
<td>
26+
Syncfusion.Compression.Base<br/>
27+
Syncfusion.ImagePreProcessor.Base<br/>
28+
Syncfusion.OCRProcessor.Base<br/>
29+
Syncfusion.Pdf.Imaging.Base<br/>
30+
Syncfusion.Pdf.Base<br/>
31+
Syncfusion.PdfToImageConverter.Base<br/>
32+
Syncfusion.SmartFormRecognizer.Base<br/>
33+
Syncfusion.SmartTableExtractor.Base<br/>
34+
</td>
35+
</tr>
36+
<tr>
37+
<td>
38+
{{'.NET Core'| markdownify }}
39+
and {{'.NET Platforms'| markdownify }}
40+
</td>
41+
<td>
42+
Syncfusion.Compression.Portable<br/>
43+
Syncfusion.ImagePreProcessor.Portable<br/>
44+
Syncfusion.OCRProcessor.Portable<br/>
45+
Syncfusion.Pdf.Imaging.Portable<br/>
46+
Syncfusion.Pdf.Portable<br/>
47+
Syncfusion.PdfToImageConverter.Portable<br/>
48+
Syncfusion.SmartFormRecognizer.Portable<br/>
49+
Syncfusion.SmartTableExtractor.Portable<br/>
50+
</td>
51+
</tr>
52+
<tr>
53+
<td>
54+
{{'.NET Multi-platform App UI (.NET MAUI)'| markdownify }}
55+
</td>
56+
<td>
57+
Syncfusion.Compression.NET<br/>
58+
Syncfusion.ImagePreProcessor.NET<br/>
59+
Syncfusion.OCRProcessor.NET<br/>
60+
Syncfusion.Pdf.Imaging.NET<br/>
61+
Syncfusion.Pdf.NET<br/>
62+
Syncfusion.PdfToImageConverter.NET<br/>
63+
Syncfusion.SmartFormRecognizer.NET<br/>
64+
Syncfusion.SmartTableExtractor.NET<br/>
65+
</td>
66+
</tr>
67+
</tbody>
68+
</table>
69+
70+
71+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: FAQ for SmartDataExtractor | Syncfusion
3+
description: This section provides answers to frequently asked questions about Syncfusion Smart Data Extractor, helping users resolve common issues.
4+
platform: document-processing
5+
control: SmartDataExtractor
6+
documentation: UG
7+
keywords: Assemblies
8+
---
9+
10+
# How to resolve the “ONNX file missing” error in Smart Data Extractor
11+
12+
Problem:
13+
14+
When running Smart Data Extractor you may see an exception similar to the following:
15+
16+
```
17+
Microsoft.ML.OnnxRuntime.OnnxRuntimeException: '[ErrorCode:NoSuchFile] Load model from <path>\runtimes\models\syncfusion_doclayout.onnx failed. File doesn't exist'
18+
```
19+
20+
Cause:
21+
22+
This error occurs because the required ONNX model files (used internally for layout and data extraction) are not present in the application's build output (the project's `bin` runtime folder). The extractor expects the models under `runtimes\models` so the runtime can load them.
23+
24+
Solution:
25+
26+
1. Run a build so the application output is generated under `bin\Debug\netX.X\runtimes` (or your configured build configuration and target framework).
27+
2. Locate the project's build output `bin` path (for example: `bin\Debug\net6.0\runtimes`).
28+
3. Place all required ONNX model files into a `runtimes\models` folder inside that bin path.
29+
4. In Visual Studio, for each ONNX file set **Properties → Copy to Output Directory → Copy always** so the model is included on every build.
30+
5. Rebuild and run your project. The extractor should now find the ONNX models and operate correctly.
31+
32+
Notes:
33+
34+
- If you publish your application, ensure the `runtimes\models` folder and ONNX files are included in the publish output (you may need to mark files as content in the project file or use a <Content> entry).
35+
- If you prefer an automated approach, add the ONNX files to your project with `CopyToOutputDirectory` set, or create a post-build step to copy the models into the runtime folder.
36+
37+
If the problem persists after adding the model files, verify file permissions and the correctness of the model file names.

0 commit comments

Comments
 (0)