Skip to content

Commit 2cfe21b

Browse files
committed
Merge branch 'hotfix/hotfix-v33.1.44' of https://github.com/syncfusion-content/document-processing-docs into 1016957-ugh
2 parents ecdceb6 + 7e8d2c0 commit 2cfe21b

19 files changed

Lines changed: 1306 additions & 899 deletions

File tree

Document-Processing-toc.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@
10491049
<li><a href="/document-processing/pdf/pdf-viewer/react/toolbar-customization/custom-toolbar">Custom Toolbar</a></li>
10501050
</ul>
10511051
</li>
1052-
<li><a href="/document-processing/pdf/pdf-viewer/react/navigation">Interactive PDF Navigation</a>
1052+
<li><a href="/document-processing/pdf/pdf-viewer/react/interactive-pdf-navigation/overview">Interactive PDF Navigation</a>
10531053
<ul>
10541054
<li><a href="/document-processing/pdf/pdf-viewer/react/interactive-pdf-navigation/page">Page Navigation</a></li>
10551055
<li><a href="/document-processing/pdf/pdf-viewer/react/interactive-pdf-navigation/bookmark">Bookmark Navigation</a></li>
@@ -1059,7 +1059,14 @@
10591059
</li>
10601060
<li><a href="/document-processing/pdf/pdf-viewer/react/magnification">Magnification</a></li>
10611061
<li><a href="/document-processing/pdf/pdf-viewer/react/accessibility">Accessibility</a></li>
1062-
<li><a href="/document-processing/pdf/pdf-viewer/react/text-search">Text Search</a></li>
1062+
<li><a href="/document-processing/pdf/pdf-viewer/react/text-search/overview">Text Search and Extraction</a>
1063+
<ul>
1064+
<li><a href="/document-processing/pdf/pdf-viewer/react/text-search/text-search-features">Text Search</a></li>
1065+
<li><a href="/document-processing/pdf/pdf-viewer/react/text-search/text-search-events">Text Search Events</a></li>
1066+
<li><a href="/document-processing/pdf/pdf-viewer/react/text-search/find-text">Find Text Method</a></li>
1067+
<li><a href="/document-processing/pdf/pdf-viewer/react/how-to/extract-text">Extract Text with Options</a></li>
1068+
</ul>
1069+
</li>
10631070
<li>Annotation
10641071
<ul>
10651072
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/overview">Overview</a></li>

Document-Processing/Common/Font-Manager/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).

Document-Processing/Data-Extraction/Smart-Form-Recognizer/NET/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ FormRecognizer smartFormRecognizer = new FormRecognizer();
3636
//Read the input PDF file as stream
3737
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
3838
//Recognize the form and get the output as PDF stream
39-
PdfLoadedDocument pdfLoadedDocument =recognizer.RecognizeFormAsPdfDocument(inputStream);
39+
PdfLoadedDocument pdfLoadedDocument = smartFormRecognizer.RecognizeFormAsPdfDocument(inputStream);
4040
//Save the loadeddocument
4141
pdfLoadedDocument.Save(Output.pdf);
4242

Document-Processing/Data-Extraction/Smart-Form-Recognizer/NET/recognize-forms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void Button_Click(object sender, RoutedEventArgs e)
2626
//Read the input PDF file as stream
2727
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
2828
//Recognize the form and get the output as PDF stream
29-
PdfLoadedDocument pdfLoadedDocument =recognizer.RecognizeFormAsPdfDocument(inputStream);
29+
PdfLoadedDocument pdfLoadedDocument = smartFormRecognizer.RecognizeFormAsPdfDocument(inputStream);
3030
//Save the loadeddocument
3131
pdfLoadedDocument.Save(Output.pdf);
3232
}
@@ -45,7 +45,7 @@ public async void Button_Click(object sender, RoutedEventArgs e)
4545
//Read the input PDF file as stream
4646
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
4747
//Recognize the form and get the output as PDF stream
48-
PdfLoadedDocument pdfLoadedDocument = await recognizer.RecognizeFormAsPdfDocumentAsync(inputStream);
48+
PdfLoadedDocument pdfLoadedDocument = await smartFormRecognizer.RecognizeFormAsPdfDocumentAsync(inputStream);
4949
//Save the loadeddocument
5050
pdfLoadedDocument.Save(Output.pdf);
5151
}

Document-Processing/Data-Extraction/Smart-Form-Recognizer/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ FormRecognizer smartFormRecognizer = new FormRecognizer();
8484
//Read the input PDF file as stream
8585
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
8686
//Recognize the form and get the output as PDF stream
87-
PdfLoadedDocument pdfLoadedDocument =recognizer.RecognizeFormAsPdfDocument(inputStream);
87+
PdfLoadedDocument pdfLoadedDocument = smartFormRecognizer.RecognizeFormAsPdfDocument(inputStream);
8888
//Save the loadeddocument
8989
pdfLoadedDocument.Save(Output.pdf);
9090

Document-Processing/PDF/PDF-Viewer/react/Redaction/overview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ domainurl: ##DomainURL##
1212

1313
Redaction annotations hide confidential or sensitive information in a PDF. The Syncfusion React PDF Viewer (EJ2) enables marking areas or entire pages for redaction, customizing appearance, and applying changes permanently.
1414

15+
Check out the following video to learn how to Redact PDF Content in the React PDF Viewer.
16+
{% youtube "https://www.youtube.com/watch?v=ZW9DswdpA7Q" %}
17+
1518
## Enable the redaction toolbar
1619

1720
To enable the redaction toolbar, configure the [`toolbarSettings.toolbarItems`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/toolbarsettings#toolbaritems) property of the PdfViewer instance to include the **RedactionEditTool**. See this [guide](./toolbar#enable-redaction-toolbar) to enable redaction toolbar.

Document-Processing/PDF/PDF-Viewer/react/how-to/extract-text.md

Lines changed: 46 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,86 +7,73 @@ platform: document-processing
77
documentation: ug
88
---
99

10-
## Extract text method in the PDF Viewer
10+
# Extract text method in the PDF Viewer
11+
12+
## Overview
1113

1214
The `extractText` method retrieves text content and, optionally, positional data for elements on one or more pages. It returns a Promise that resolves to an object containing extracted `textData` (detailed items with bounds) and `pageText` (concatenated plain text).
1315

14-
**Parameters overview:**
16+
## Parameters
1517

1618
- `startIndex` — Starting page index (0-based).
17-
- `endIndex` or options — Either the ending page index for a range extraction, or an options object specifying extraction criteria for a single page.
19+
- `endIndex` or `options` — Either the ending page index for a range extraction, or an options object specifying extraction criteria for a single page.
1820
- `options` (optional) — Extraction options such as `TextOnly` or `TextAndBounds` to control whether bounds are included.
1921

20-
**Returned object shape (example):**
22+
## Returned object
2123

2224
- `textData` — Array of objects describing extracted text items, including bounds and page-level text.
2325
- `pageText` — Concatenated plain text for the specified page(s).
2426

25-
### Usage of extractText in Syncfusion PDF Viewer Control
27+
## Complete example
2628

2729
Here is an example that demonstrates how to use the extractText method along with event handling:
2830

29-
```html
30-
<body>
31-
<button onclick="extrctText()">extrctText</button>
32-
<button onclick="extrctsText()">extrctsText</button>
33-
<div id='sample'>
34-
<div id='loader'>Loading....</div>
35-
</div>
36-
</body>
37-
38-
<script>
39-
// Function to extract text from a specific page (page 1)
40-
function extrctText(){
41-
var viewer = document.getElementById('container').ej2_instances[0];
42-
viewer.extractText(1, 'TextOnly').then((val) => {
43-
console.log('Extracted Text from Page 1:');
44-
console.log(val);
45-
});
46-
}
47-
// Function to extract text from a range of pages (pages 0 to 2)
48-
function extrctsText(){
49-
var viewer = document.getElementById('container').ej2_instances[0];
50-
viewer.extractText(0, 2, 'TextOnly').then((val) => {
51-
console.log('Extracted Text from Pages 0 to 2:');
52-
console.log(val);
53-
});
54-
}
55-
</script>
56-
```
57-
5831
{% tabs %}
59-
{% highlight ts tabtitle="Standalone" %}
32+
{% highlight ts tabtitle="App.tsx" %}
6033
{% raw %}
34+
import {
35+
PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView,
36+
ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner,
37+
PageOrganizer, Inject, ExtractTextOption
38+
} from '@syncfusion/ej2-react-pdfviewer';
39+
import { useRef, RefObject } from 'react';
6140

62-
import * as ReactDOM from 'react-dom';
63-
import * as React from 'react';
64-
import './index.css';
65-
import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner, Inject } from '@syncfusion/ej2-react-pdfviewer';
66-
export function App() {
67-
return (<div>
68-
<div className='control-section'>
69-
<PdfViewerComponent
70-
id="container"
71-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
72-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"
73-
style={{ height: '680px' }}
74-
>
75-
<Inject services={[Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, BookmarkView, ThumbnailView,
76-
Print, TextSelection, TextSearch, FormFields, FormDesigner]} />
77-
</PdfViewerComponent>
78-
</div>
79-
</div>);
41+
export default function App() {
42+
const viewerRef: RefObject<PdfViewerComponent | null> = useRef<PdfViewerComponent>(null);
43+
const extractText = async () => {
44+
console.log(await viewerRef.current?.extractText(1, ExtractTextOption.TextOnly));
45+
}
46+
const extractsText = async () => {
47+
console.log(await viewerRef.current?.extractText(0, 2, ExtractTextOption.TextOnly));
48+
}
49+
return (
50+
<div style={{ height: '100vh' }}>
51+
<button onClick={extractText}>Single page</button>
52+
<button onClick={extractsText}>Multiple pages</button>
53+
<PdfViewerComponent
54+
id="PdfViewer"
55+
ref={viewerRef}
56+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
57+
resourceUrl="https://cdn.syncfusion.com/ej2/32.2.3/dist/ej2-pdfviewer-lib"
58+
style={{ height: '100%' }}
59+
>
60+
<Inject
61+
services={[
62+
Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, BookmarkView,
63+
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer
64+
]}
65+
/>
66+
</PdfViewerComponent>
67+
</div>
68+
);
8069
}
81-
const root = ReactDOM.createRoot(document.getElementById('sample'));
82-
root.render(<App />);
83-
8470
{% endraw %}
8571
{% endhighlight %}
8672
{% endtabs %}
8773

88-
#### Explanation
89-
- Single page: Extracts text from page 1 (`startIndex = 1`) using `TextOnly`.
90-
- Multiple pages: Extracts text from pages 0–2 (`startIndex = 0, endIndex = 2`) using `TextOnly`.
74+
**Expected result:**
75+
76+
- Clicking single page, extracts text from page 1 (`startIndex = 1`) using `TextOnly`.
77+
- Clicking multiple pages, extracts text from pages 0–2 (`startIndex = 0, endIndex = 2`) using `TextOnly`.
9178

9279
[View Sample in GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples/tree/master/How%20to)

0 commit comments

Comments
 (0)