Skip to content

Commit 9c8552e

Browse files
Addressed the review changes
1 parent 583a772 commit 9c8552e

4 files changed

Lines changed: 156 additions & 45 deletions

File tree

Document-Processing/DataExtraction/SmartDataExtractor/NET/Assemblies-Required.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The following assemblies need to be referenced in your application based on the
1919
<tbody>
2020
<tr>
2121
<td>
22-
{{'[WPF](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-wpf)'| markdownify }},
23-
{{'[Windows Forms](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-windows-forms)'| markdownify }} and {{'[ASP.NET MVC](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-mvc)'| markdownify }}
22+
{{'[WPF]'| markdownify }},
23+
{{'[Windows Forms]'| markdownify }} and {{'[ASP.NET MVC]'| markdownify }}
2424
</td>
2525
<td>
2626
Syncfusion.Compression.Base<br/>
@@ -35,9 +35,9 @@ The following assemblies need to be referenced in your application based on the
3535
</tr>
3636
<tr>
3737
<td>
38-
{{'[Blazor](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-document-in-blazor)'| markdownify }},
39-
{{'[.NET Core](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-core)'| markdownify }}
40-
and {{'[.NET Platforms](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-mvc)'| markdownify }}
38+
{{'[Blazor]'| markdownify }},
39+
{{'[.NET Core]'| markdownify }}
40+
and {{'[.NET Platforms]'| markdownify }}
4141
</td>
4242
<td>
4343
Syncfusion.Compression.Portable<br/>
@@ -52,8 +52,7 @@ The following assemblies need to be referenced in your application based on the
5252
</tr>
5353
<tr>
5454
<td>
55-
{{'[Windows UI library (WinUI)](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-winui)'| markdownify }},
56-
{{'[.NET Multi-platform App UI (.NET MAUI)](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-maui)'| markdownify }}
55+
{{'[.NET Multi-platform App UI (.NET MAUI)]'| markdownify }}
5756
</td>
5857
<td>
5958
Syncfusion.Compression.NET<br/>

Document-Processing/DataExtraction/SmartDataExtractor/NET/Features.md

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,33 @@ using System.IO;
8383
using Syncfusion.SmartDataExtractor;
8484
using System.Text;
8585

86-
string inputPath = "Image.png";
86+
//Open the input image file as a stream.
87+
using (FileStream stream = new FileStream("Image.png", FileMode.Open, FileAccess.Read))
88+
{
89+
//Initialize the Data Extractor.
90+
DataExtractor extractor = new DataExtractor();
91+
//Enable form detection in the image document.
92+
extractor.EnableFormDetection = true;
93+
//Enable table detection in the image document.
94+
extractor.EnableTableDetection = true;
95+
//Set confidence threshold for extraction.
96+
extractor.ConfidenceThreshold = 0.6;
97+
//Extract data as JSON from the image stream.
98+
string data = extractor.ExtractDataAsJson(stream);
99+
//Save the extracted JSON data into an output file.
100+
File.WriteAllText("Output.json", data, Encoding.UTF8);
101+
}
102+
103+
{% endhighlight %}
104+
105+
{% highlight c# tabtitle="C# [Windows-specific]" %}
106+
107+
using System.IO;
108+
using Syncfusion.SmartDataExtractor;
109+
using System.Text;
87110

88111
//Open the input image file as a stream.
89-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
112+
using (FileStream stream = new FileStream("Image.png", FileMode.Open, FileAccess.Read))
90113
{
91114
//Initialize the Data Extractor.
92115
DataExtractor extractor = new DataExtractor();
@@ -119,16 +142,15 @@ using Syncfusion.SmartDataExtractor;
119142
using Syncfusion.SmartFormRecognizer;
120143
using System.Text;
121144

122-
string inputPath = "Input.pdf";
123-
124145
//Open the input PDF file as a stream.
125-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
146+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
126147
{
127148
//Initialize the Smart Data Extractor.
128149
DataExtractor extractor = new DataExtractor();
129150

130151
//Enable form detection in the document.
131152
extractor.EnableFormDetection = true;
153+
extractor.EnableTableDetection = false;
132154
//Set confidence threshold for extraction.
133155
extractor.ConfidenceThreshold = 0.6
134156
//Configure form recognition options.
@@ -160,16 +182,15 @@ using Syncfusion.SmartDataExtractor;
160182
using Syncfusion.SmartFormRecognizer;
161183
using System.Text;
162184

163-
string inputPath = "Input.pdf";
164-
165185
//Open the input PDF file as a stream.
166-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
186+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
167187
{
168188
//Initialize the Smart Data Extractor.
169189
DataExtractor extractor = new DataExtractor();
170190

171191
//Enable form detection in the document.
172192
extractor.EnableFormDetection = true;
193+
extractor.EnableTableDetection = false;
173194
//Set confidence threshold for extraction.
174195
extractor.ConfidenceThreshold = 0.6
175196
//Configure form recognition options.
@@ -209,16 +230,15 @@ using Syncfusion.Pdf.Parsing;
209230
using Syncfusion.SmartDataExtractor;
210231
using Syncfusion.SmartFormRecognizer;
211232

212-
string inputPath = "Input.pdf";
213-
214233
//Open the input PDF file as a stream.
215-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
234+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
216235
{
217236
//Initialize the Smart Data Extractor.
218237
DataExtractor extractor = new DataExtractor();
219238

220239
//Enable form detection in the document to identify form fields.
221240
extractor.EnableFormDetection = true;
241+
extractor.EnableTableDetection = false;
222242
//Apply confidence threshold to extract only reliable data.
223243
extractor.ConfidenceThreshold = 0.6;
224244

@@ -258,10 +278,8 @@ using Syncfusion.Pdf.Parsing;
258278
using Syncfusion.SmartDataExtractor;
259279
using Syncfusion.SmartFormRecognizer;
260280

261-
string inputPath = "Input.pdf";
262-
263281
//Open the input PDF file as a stream.
264-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
282+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
265283
{
266284
//Initialize the Smart Data Extractor.
267285
DataExtractor extractor = new DataExtractor();
@@ -315,14 +333,14 @@ using Syncfusion.SmartDataExtractor;
315333
using Syncfusion.SmartTableExtractor;
316334

317335
// Load the input PDF file.
318-
string inputPath = "Input.pdf";
319-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
336+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
320337
{
321338
// Initialize the Smart Data Extractor.
322339
DataExtractor extractor = new DataExtractor();
323340

324341
// Enable table detection and set confidence threshold.
325342
extractor.EnableTableDetection = true;
343+
extractor.EnableFormDetection = false;
326344
extractor.ConfidenceThreshold = 0.6;
327345

328346
// Configure table extraction options.
@@ -355,14 +373,14 @@ using Syncfusion.SmartDataExtractor;
355373
using Syncfusion.SmartTableExtractor;
356374

357375
// Load the input PDF file.
358-
string inputPath = "Input.pdf";
359-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
376+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
360377
{
361378
// Initialize the Smart Data Extractor.
362379
DataExtractor extractor = new DataExtractor();
363380

364381
// Enable table detection and set confidence threshold.
365382
extractor.EnableTableDetection = true;
383+
extractor.EnableFormDetection = false;
366384
extractor.ConfidenceThreshold = 0.6;
367385

368386
// Configure table extraction options.
@@ -401,14 +419,14 @@ using Syncfusion.Pdf.Parsing;
401419
using Syncfusion.SmartDataExtractor;
402420

403421
// Load the input PDF file.
404-
string inputPath = "Input.pdf";
405-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
422+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
406423
{
407424
// Initialize the Smart Data Extractor.
408425
DataExtractor extractor = new DataExtractor();
409426

410427
// Apply confidence threshold to extract the data.
411428
// Only elements with confidence >= 0.75 will be included in the results.
429+
//default confidence threshold value is 0.6
412430
extractor.ConfidenceThreshold = 0.75;
413431
// Extract data and return as a loaded PDF document.
414432
PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream);
@@ -428,14 +446,14 @@ using Syncfusion.Pdf.Parsing;
428446
using Syncfusion.SmartDataExtractor;
429447

430448
// Load the input PDF file.
431-
string inputPath = "Input.pdf";
432-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
449+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
433450
{
434451
// Initialize the Smart Data Extractor.
435452
DataExtractor extractor = new DataExtractor();
436453

437454
// Apply confidence threshold to extract the data.
438455
// Only elements with confidence >= 0.75 will be included in the results.
456+
//default confidence threshold value is 0.6
439457
extractor.ConfidenceThreshold = 0.75;
440458
// Extract data and return as a loaded PDF document.
441459
PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream);
@@ -462,10 +480,8 @@ using System.IO;
462480
using Syncfusion.Pdf.Parsing;
463481
using Syncfusion.SmartDataExtractor;
464482

465-
string inputPath = "Input.pdf";
466-
467483
//Open the input PDF file as a stream.
468-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
484+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
469485
{
470486
//Initialize the Smart Data Extractor.
471487
DataExtractor extractor = new DataExtractor();
@@ -491,10 +507,8 @@ using System.IO;
491507
using Syncfusion.Pdf.Parsing;
492508
using Syncfusion.SmartDataExtractor;
493509

494-
string inputPath = "Input.pdf";
495-
496510
//Open the input PDF file as a stream.
497-
using (FileStream stream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
511+
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
498512
{
499513
//Initialize the Smart Data Extractor.
500514
DataExtractor extractor = new DataExtractor();

Document-Processing/DataExtraction/SmartTableExtractor/NET/Assemblies-Required.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The following assemblies need to be referenced in your application based on the
1919
<tbody>
2020
<tr>
2121
<td>
22-
{{'[WPF](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-wpf)'| markdownify }},
23-
{{'[Windows Forms](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-windows-forms)'| markdownify }} and {{'[ASP.NET MVC](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-mvc)'| markdownify }}
22+
{{'[WPF]'| markdownify }},
23+
{{'[Windows Forms]'| markdownify }} and {{'[ASP.NET MVC]'| markdownify }}
2424
</td>
2525
<td>
2626
Syncfusion.Compression.Base<br/>
@@ -32,9 +32,9 @@ The following assemblies need to be referenced in your application based on the
3232
</tr>
3333
<tr>
3434
<td>
35-
{{'[Blazor](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-document-in-blazor)'| markdownify }},
36-
{{'[.NET Core](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-core)'| markdownify }}
37-
and {{'[.NET Platforms](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-asp-net-mvc)'| markdownify }}
35+
{{'[Blazor]'| markdownify }},
36+
{{'[.NET Core]'| markdownify }}
37+
and {{'[.NET Platforms]'| markdownify }}
3838
</td>
3939
<td>
4040
Syncfusion.Compression.Portable<br/>
@@ -47,8 +47,7 @@ The following assemblies need to be referenced in your application based on the
4747
</tr>
4848
<tr>
4949
<td>
50-
{{'[Windows UI library (WinUI)](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-winui)'| markdownify }},
51-
{{'[.NET Multi-platform App UI (.NET MAUI)](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/create-pdf-file-in-maui)'| markdownify }}
50+
{{'[.NET Multi-platform App UI (.NET MAUI)]'| markdownify }}
5251
</td>
5352
<td>
5453
Syncfusion.Compression.NET<br/>

0 commit comments

Comments
 (0)