Skip to content

Commit 504c6c4

Browse files
Merge pull request #2449 from syncfusion-content/1012753-Add-ink-and-font-manager-changes
1012753- Addressed feedback in Ink and Dedicated Font Manager page of DocIO
2 parents 2330aeb + 8f444a8 commit 504c6c4

4 files changed

Lines changed: 38 additions & 22 deletions

File tree

Document-Processing-toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7751,7 +7751,7 @@
77517751
Common
77527752
<ul>
77537753
<li>
7754-
<a href="/document-processing/common/font-manager/font-manager">Font Manager</a>
7754+
<a href="/document-processing/common/font-manager">Font Manager</a>
77557755
</li>
77567756
</ul>
77577757
</li>

Document-Processing/Common/Font-Manager/font-manager.md renamed to Document-Processing/Common/font-manager.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ documentation: UG
1111

1212
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.
1313

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.
14+
To address this challenge, Syncfusion Document Processing libraries introduce the [FontManager](https://help.syncfusion.com/cr/document-processing/Syncfusion.Drawing.Fonts.FontManager.html) class, which provides centralized font management shared across all threads and conversion libraries. This approach eliminates duplicate font objects and significantly reduces memory overhead.
1515

1616
## Key Features
1717

@@ -55,14 +55,12 @@ FontManager optimizes memory usage across the following Office to PDF/Image conv
5555
<td>
5656
<b>PDF Library Operations</b>
5757
<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>
58+
<li>PDF/A Creation and Conversion</li>
59+
<li>Annotations and Forms: Fill and Flatten</li>
60+
<li>XPS to PDF Conversion</li>
61+
<li>EMF to PDF Conversion</li>
62+
<li>Insert Text in PDF</li>
63+
<li>Tables and Light Tables (Data Grids in PDF)</li>
6664
</ul>
6765
</td>
6866
</tr>
@@ -72,7 +70,7 @@ N> FontManager automatically manages fonts across all these conversion types, wh
7270

7371
## Configuring Automatic Font Cleanup
7472

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.
73+
The [FontManager.Delay](https://help.syncfusion.com/cr/document-processing/Syncfusion.Drawing.Fonts.FontManager.html#Syncfusion_Drawing_Fonts_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.
7674

7775
**Default value:** 30,000 milliseconds (30 seconds),
7876
**Valid range:** 1 to 2,147,483,647 milliseconds.
@@ -120,7 +118,7 @@ app.Run();
120118

121119
## Immediate Font Cache Cleanup
122120

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.
121+
The [FontManager.ClearCache()](https://help.syncfusion.com/cr/document-processing/Syncfusion.Drawing.Fonts.FontManager.html#Syncfusion_Drawing_Fonts_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.
124122

125123
**Use cases:**
126124

@@ -165,6 +163,8 @@ app.Run();
165163
{% endhighlight %}
166164
{% endtabs %}
167165

166+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Unified-font-manager/.NET/).
167+
168168
## Best Practices
169169

170170
1. Set FontManager.Delay early: Configure the delay property in your application's startup code before any document processing begins (Optional).
-15.2 KB
Binary file not shown.

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ An Ink annotation is a freehand drawing or handwritten input composed of stroke
1111

1212
N> DocIO supports Ink only in DOCX format documents.
1313

14-
You can insert Ink elements in the document by using the drawing tools available under the **Draw** tab in Word.
15-
![Process](Ink_images/Ink-tab.png)
16-
1714
## Create Ink
1815

1916
The following code example illustrating how to create an Ink in a Word document.
2017

2118
{% tabs %}
2219

23-
{% highlight c# tabtitle="C# [Cross-platform]" %}
20+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Create-ink/.NET/Create-ink/Program.cs" %}
2421

2522
//Creates a new Word document.
2623
WordDocument document = new WordDocument();
@@ -128,13 +125,15 @@ document.Close()
128125
By running the above code, you will generate a a document with **Ink elements** as shown below.
129126
![Process](Ink_images/Create-Ink.png)
130127

128+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Create-ink/.NET/).
129+
131130
## Create Ink with Multiple Traces
132131

133132
The following code example illustrating how to create an Ink with Multiple Traces (strokes) in a Word document.
134133

135134
{% tabs %}
136135

137-
{% highlight c# tabtitle="C# [Cross-platform]" %}
136+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Create-ink-with-multipletraces/.NET/Create-ink-with-multipletraces/Program.cs" %}
138137

139138
//Creates a new Word document.
140139
WordDocument document = new WordDocument();
@@ -250,6 +249,8 @@ document.Close()
250249
By running the above code, you will generate an **Ink with multiple trace points** as shown below.
251250
![Process](Ink_images/Ink-multipletraces.png)
252251

252+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Create-ink-with-multipletraces/.NET/).
253+
253254
The following code example shows GetPoints method which is used to get trace points.
254255

255256
{% tabs %}
@@ -377,7 +378,7 @@ The following code example demonstrates how to customize the Ink Effect.
377378

378379
{% tabs %}
379380

380-
{% highlight c# tabtitle="C# [Cross-platform]" %}
381+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Modify-ink-effect/.NET/Modify-ink-effect/Program.cs" %}
381382

382383
//Opens the template document
383384
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
@@ -439,13 +440,15 @@ document.Close()
439440
By running the above code, you will generate a **Modified ink effect** as shown below.
440441
![Process](Ink_images/Modify-ink-effect.png)
441442

443+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Modify-ink-effect/.NET/).
444+
442445
### Modify Ink Color
443446

444447
The following code example demonstrates how to customize the Ink Color.
445448

446449
{% tabs %}
447450

448-
{% highlight c# tabtitle="C# [Cross-platform]" %}
451+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Modify-ink-color/.NET/Modify_ink_color/Program.cs" %}
449452

450453
//Opens the template document
451454
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
@@ -509,13 +512,15 @@ document.Close()
509512
By running the above code, you will generate a **Modified ink color** as shown below.
510513
![Process](Ink_images/Modify-ink-color.png)
511514

515+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Modify-ink-color/.NET/).
516+
512517
### Modify Ink Thickness
513518

514519
The following code example demonstrates how to customize the Ink thickness.
515520

516521
{% tabs %}
517522

518-
{% highlight c# tabtitle="C# [Cross-platform]" %}
523+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Modify-ink-thickness/.NET/Modify-ink-thickness/Program.cs" %}
519524

520525
//Opens the template document
521526
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
@@ -579,13 +584,15 @@ document.Close()
579584
By running the above code, you will generate a **Modified ink thickness** as shown below.
580585
![Process](Ink_images/Modify-ink-thickness.png)
581586

587+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Modify-ink-thickness/.NET/).
588+
582589
### Modify Ink Points
583590

584591
The following code example demonstrates how to customize the Ink Points.
585592

586593
{% tabs %}
587594

588-
{% highlight c# tabtitle="C# [Cross-platform]" %}
595+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Modify-ink-points/.NET/Modify-ink-Points/Program.cs" %}
589596

590597
//Opens the template document
591598
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
@@ -649,13 +656,15 @@ document.Close()
649656
By running the above code, you will generate **modified ink points** as shown below.
650657
![Process](Ink_images/Modify-ink-points.png)
651658

659+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Modify-ink-points/.NET/).
660+
652661
## Remove Ink
653662

654663
You can remove ink by iterating through Ink objects or specifying an index. The following code example demonstrates how to remove the Ink.
655664

656665
{% tabs %}
657666

658-
{% highlight c# tabtitle="C# [Cross-platform]" %}
667+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/Ink/Remove-ink/.NET/Remove_ink/Program.cs" %}
659668

660669
//Opens the template document
661670
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
@@ -730,6 +739,8 @@ document.Close()
730739

731740
By running the above code, you will generate a **Remove Ink** as shown below.
732741
![Process](Ink_images/Remove-ink.png)
742+
743+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Ink/Remove-ink/.NET/).
733744

734745
## Limitations
735746

@@ -758,3 +769,8 @@ During Word-to-PDF and Word-to-Image conversions, Syncfusion Word Library uses f
758769
* [How Trace Points Are Calculated?](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/paragraph-and-paragraph-items-faqs#how-trace-points-are-calculated)
759770
* [Example: Triangle Ink Trace Points](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/paragraph-and-paragraph-items-faqs#example:-triangle-ink-trace-points)
760771
* [How to Set Stroke Thickness?](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/paragraph-and-paragraph-items-faqs#how-to-set-stroke-thickness)
772+
773+
## Online Demo
774+
775+
* Explore how to create a Word document with Ink using the .NET Word Library (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/createink#/tailwind).
776+
* Explore how to edit a Word document with Ink using the .NET Word Library (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/editink#/tailwind).

0 commit comments

Comments
 (0)