Skip to content

Commit e6872f9

Browse files
committed
Merge branch 'hotfix/hotfix-v34.1.29' of https://github.com/syncfusion-content/document-processing-docs into ES-1041967-SpreadsheetEditor
2 parents ba7570a + 679d7d0 commit e6872f9

117 files changed

Lines changed: 3309 additions & 1884 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/Data-Extraction/NET/Extract-Data-in-ASP-NET-Core.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,21 @@ To include the Smart Data Extractor library in your ASP.NET Core application, pl
3030
Step 1: Create a new C# ASP.NET Core Web Application project.
3131
![Create ASP.NET Core Web application in Visual Studio](GettingStarted_images/ASPNETCoreProjectCreation.png)
3232

33-
Step 2: In configuration window, name your project and click Next.
33+
Step 2: In the configuration window, name your project and click Next.
3434
![Select Web Application pattern](GettingStarted_images/ASPNETCoreConfiguration.png)
3535
![Select version](GettingStarted_images/ASPNETCoreAdditionalInfo.png)
3636

3737

38-
Step 3: Install the [Syncfusion.SmartDataExtractor.Net.Core](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.Net.Core/) package as reference to your ASP.NET Core applications from [NuGet.org](https://www.nuget.org/).
38+
Step 3: Install the [Syncfusion.SmartDataExtractor.Net.Core](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.Net.Core/) package as a reference for your ASP.NET Core application from [NuGet.org](https://www.nuget.org/).
3939
![Install SmartDataExtractor .NET Core NuGet package](GettingStarted_images/ASPNETCore_Nuget.png)
4040

41+
Add the input PDF file named **Input.pdf** to the project root directory before running the sample.
42+
4143
Step 4: A default controller named HomeController.cs is added on creation of ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
4244

4345
{% highlight c# tabtitle="C#" %}
4446

47+
using System.IO;
4548
using System.Text;
4649
using System.Diagnostics;
4750
using Syncfusion.SmartDataExtractor;
@@ -71,7 +74,7 @@ Step 6: Add a new action method named `ExtractData` in HomeController.cs and inc
7174
// Open the input PDF file as a stream.
7275
using (FileStream stream = new FileStream(Path.GetFullPath("Input.pdf"), FileMode.Open, FileAccess.Read))
7376
{
74-
// Initialize the Data Extractor.
77+
// Initialize the Data Extractor.
7578
DataExtractor extractor = new DataExtractor();
7679
// Extract form data as JSON.
7780
string data = extractor.ExtractDataAsJson(stream);
@@ -149,7 +152,7 @@ Step 6: A default action method named Index will be present in HomeController.cs
149152

150153
{% endhighlight %}
151154

152-
Step 7: Add a new action method named `ExportToJson` in HomeController.cs and include the following code example to extract data as JSON using the DataExtractor (help.syncfusion.com in Bing) class. Then use the **ExtractDataAsJson** method of the DataExtractor object to process the input and export the results in JSON format.
155+
Step 7: Add a new action method named `ExtractData` in HomeController.cs and include the following code example to extract data as JSON using the [DataExtractor](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html) class. Then use the [ExtractDataAsJson](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html#Syncfusion_SmartDataExtractor_DataExtractor_ExtractDataAsJson_System_IO_Stream_) method of the DataExtractor object to process the input and export the results in JSON format.
153156

154157
{% highlight c# tabtitle="C#" %}
155158

Document-Processing/Data-Extraction/NET/Extract-Data-in-ASP-NET-MVC.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Step 2: In the project configuration window, name your project and select Create
2121
![Configuration window1](GettingStarted_images/MVC_Data_ProjectCreation.png)
2222
![Configuration window2](GettingStarted_images/CreateASPNetMVCProject_DataExtractor.png)
2323

24-
Step 3: Install [Syncfusion.SmartDataExtractor.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.AspNet.Mvc5) NuGet package as reference to your .NET application from [NuGet.org](https://www.nuget.org/).
24+
Step 3: Install [Syncfusion.SmartDataExtractor.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.AspNet.Mvc5) NuGet package as a reference for your ASP.NET MVC application from [NuGet.org](https://www.nuget.org/).
2525
![NuGet package installation](GettingStarted_images/MVC_DataExtractorNuget.png)
2626

27+
Add the input PDF file named **Input.pdf** to the App_Data folder before running the sample.
28+
2729
Step 4: Include the following namespaces in the HomeController.cs file.
2830

2931
{% highlight c# tabtitle="C#" %}
@@ -81,4 +83,4 @@ By executing the program, you will get the JSON file as follows.
8183
![ASP.NET MVC output JSON document](GettingStarted_images/JSON_Output.png)
8284

8385
Click [here](https://www.syncfusion.com/document-sdk/net-pdf-data-extraction) to explore the rich set of Syncfusion<sup>&reg;</sup> Data Extraction library features.
84-
86+

Document-Processing/Data-Extraction/NET/Extract-Data-in-Blazor.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The Syncfusion<sup>&reg;</sup> Smart Data Extractor is a .NET library used to ex
2121
**Prerequisites**:
2222

2323
* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download).
24-
* Install Visual Studio: Download and install Visual Studio from the [official website](https://code.visualstudio.com/download).
24+
* Install Visual Studio: Download and install Visual Studio from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
2525

2626

2727
Step 1: Create a new C# Blazor Web App project.
@@ -43,6 +43,8 @@ To **Extract Data from PDF in a Blazor Web App Server**, install [Syncfusion.Sma
4343

4444
![Install Syncfusion.SmartDataExtractor.Net.Core NuGet Package](GettingStarted_images/Blazor_Nuget.png)
4545

46+
Add the input PDF file named **Input.pdf** to the wwwroot folder before running the sample.
47+
4648
Step 3: Create a Razor file named `Home.razor` in the `Pages` folder, which is located inside the `Components` folder.
4749

4850
Add the following directives and service injections in the file
@@ -53,6 +55,7 @@ Add the following directives and service injections in the file
5355
@page "/"
5456
@rendermode InteractiveServer
5557
@using Extract_Data_Blazor.Services
58+
@using Microsoft.JSInterop
5659
@inject ExtractionService extractor
5760
@inject IJSRuntime JS
5861

@@ -112,15 +115,20 @@ Create a new method in the ExtractionService class, and add the following code s
112115
{% tabs %}
113116

114117
{% highlight c# tabtitle="C#" %}
115-
116-
using (FileStream stream = new FileStream(@"wwwroot/Input.pdf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
118+
public class ExtractionService
117119
{
118-
// Initialize the Smart Data Extractor
119-
DataExtractor extractor = new DataExtractor();
120-
// Extract data as JSON string
121-
string data = extractor.ExtractDataAsJson(stream);
122-
// Return the JSON string
123-
return data;
120+
public string RunExtraction()
121+
{
122+
using (FileStream stream = new FileStream(@"wwwroot/Input.pdf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
123+
{
124+
// Initialize the Data Extractor
125+
DataExtractor extractor = new DataExtractor();
126+
// Extract data as JSON string
127+
string data = extractor.ExtractDataAsJson(stream);
128+
// Return the JSON string
129+
return data;
130+
}
131+
}
124132
}
125133

126134
{% endhighlight %}
@@ -158,6 +166,10 @@ Create a new class file named `FileUtils` in the project and add the following c
158166

159167
{% highlight c# tabtitle="C#" %}
160168

169+
using System;
170+
using System.Threading.Tasks;
171+
using Microsoft.JSInterop;
172+
161173
public static class FileUtils
162174
{
163175
public static ValueTask<object> SaveAs(this IJSRuntime js, string filename, byte[] data)
@@ -208,7 +220,7 @@ Add the following JavaScript function in the `App.razor` file located in the roo
208220

209221
Step 11: Add navigation link.
210222

211-
Add the following code snippet to the Navigation menu's Razor file in the `Layout` folder.
223+
Add the following code snippet to the `NavMenu.razor` file in the `Layout` folder.
212224

213225
{% tabs %}
214226

@@ -262,10 +274,12 @@ Step 2: To **Extract Data from PDF in Web app**, install [Syncfusion.SmartDataEx
262274
* Run the command `dotnet add package Syncfusion.SmartDataExtractor.Net.Core` to install the NuGet package.
263275

264276
```
265-
dotnet add package Syncfusion.SmartDataExtractor.NET.Core
277+
dotnet add package Syncfusion.SmartDataExtractor.Net.Core
266278
267279
```
268280

281+
Add the input PDF file named **Input.pdf** to the wwwroot folder before running the sample.
282+
269283
Step 3: Create a Razor file named `Home.razor` in the `Pages` folder, which is located inside the `Components` folder.
270284

271285
Add the following directives and service injections in the file
@@ -276,6 +290,7 @@ Add the following directives and service injections in the file
276290
@page "/"
277291
@rendermode InteractiveServer
278292
@using Extract_Data_Blazor.Services
293+
@using Microsoft.JSInterop
279294
@inject ExtractionService extractor
280295
@inject IJSRuntime JS
281296

@@ -348,7 +363,7 @@ Create a new method in the ExtractionService class, and add the following code s
348363

349364
using (FileStream stream = new FileStream(@"wwwroot/Input.pdf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
350365
{
351-
// Initialize the Smart Data Extractor
366+
// Initialize the Data Extractor
352367
DataExtractor extractor = new DataExtractor();
353368

354369
// Extract data as JSON string

Document-Processing/Data-Extraction/NET/Extract-Data-in-Console.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,23 @@ Step 1: Create a new C# Console Application project.
2626
Step 2: Name the project.
2727
![Name the application](GettingStarted_images/ConsoleName.png)
2828

29-
Step 3: Install the [Syncfusion.SmartDataExtractor.Net.Core](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
29+
Step 3: Install the [Syncfusion.SmartDataExtractor.Net.Core](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.Net.Core) NuGet package as a reference for your console application from [NuGet.org](https://www.nuget.org).
3030
![NET Core NuGet package](GettingStarted_images/ConsoleCoreNuget.png)
3131

32+
Add the input PDF file named **Input.pdf** to the project root directory before running the sample.
33+
3234
Step 4: Include the following namespaces in the *Program.cs* file.
3335

3436
{% highlight c# tabtitle="C#" %}
3537

38+
using System.Text;
3639
using System.IO;
3740
using Syncfusion.Pdf.Parsing;
3841
using Syncfusion.SmartDataExtractor;
3942

4043
{% endhighlight %}
4144

42-
Step 5: Include the following code snippet in *Program.cs* to Extract data from an PDF file.
45+
Step 5: Include the following code snippet in *Program.cs* to extract data from a PDF file.
4346

4447
{% tabs %}
4548

@@ -84,7 +87,7 @@ Step 1: Open the terminal (Ctrl+` ) and run the following command to create a ne
8487
```
8588
dotnet new console -n ExtractDataConsoleApp
8689
```
87-
Step 2: Replace ****ExtractDataConsoleApp** with your desired project name.
90+
Step 2: Replace **ExtractDataConsoleApp** with your desired project name.
8891

8992
Step 3: Navigate to the project directory using the following command
9093

@@ -166,13 +169,16 @@ Step 1: Create a new C# Console Application (.NET Framework) project.
166169
Step 2: Name the project.
167170
![Name the application](GettingStarted_images/ConsoleFramework_ProjectName.png)
168171

169-
Step 3: Install the [Syncfusion.SmartDataExtractor.WinForms](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.WinForms/) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
172+
Step 3: Install the [Syncfusion.SmartDataExtractor.WinForms](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.WinForms/) NuGet package as a reference for your .NET Framework console application from [NuGet.org](https://www.nuget.org).
170173
![NET Framework NuGet package](GettingStarted_images/ConsoleNuget_DataExtractor.png)
171174

175+
Add the input PDF file named **Input.pdf** to the project root directory before running the sample.
176+
172177
Step 4: Include the following namespaces in the *Program.cs*.
173178

174179
{% highlight c# tabtitle="C#" %}
175180

181+
using System.Text;
176182
using System.IO;
177183
using Syncfusion.Pdf.Parsing;
178184
using Syncfusion.SmartDataExtractor;

Document-Processing/Data-Extraction/NET/Extract-Data-in-MAUI.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Step 3: Install the [Syncfusion.SmartDataExtractor.NET](https://www.nuget.org/pa
3636

3737
![Install Syncfusion.SmartDataExtractor.NET NuGet package](GettingStarted_images/MAUI_Nuget.png)
3838

39-
N> If you reference Syncfusion<sup>&reg;</sup> assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering a Syncfusion<sup>&reg;</sup> license key in your application to use our components.
39+
Add the input PDF file named **Input.pdf** to the project as a MauiAsset before running the sample.
4040

4141
Step 4: Add a new button to the **MainPage.xaml** as shown below.
4242

@@ -78,6 +78,7 @@ Step 5: Include the following namespaces in the **MainPage.xaml.cs** file.
7878

7979
{% highlight c# tabtitle="C#" %}
8080

81+
using System.IO;
8182
using System.Text;
8283
using Syncfusion.SmartDataExtractor;
8384

@@ -93,13 +94,14 @@ Step 6: Add a new action method **OnExtractDataClicked** in MainPage.xaml.cs and
9394

9495
// Load the input PDF from the app package (include it in the project as a MauiAsset)
9596
using Stream inputStream = await FileSystem.OpenAppPackageFileAsync(Path.Combine("Data", "Input.pdf"));
96-
// Initialize Smart Data Extractor
97+
// Initialize the Data Extractor
9798
DataExtractor extractor = new DataExtractor();
9899
// Extract data as JSON string
99100
string data = extractor.ExtractDataAsJson(inputStream);
100101
// Save the extracted JSON data into an output file inside the application directory
101-
string outputPath = Path.Combine(Environment.CurrentDirectory, "Output", "Output.json");
102-
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
102+
string outputDirectory = Path.Combine(FileSystem.AppDataDirectory, "Output");
103+
Directory.CreateDirectory(outputDirectory);
104+
string outputPath = Path.Combine(outputDirectory, "Output.json");
103105
File.WriteAllText(outputPath, data, Encoding.UTF8);
104106
// Show success message
105107
await DisplayAlert("Success", $"Extracted data saved to {outputPath}", "OK");
@@ -188,6 +190,7 @@ Step 4: Include the following namespaces in the **MainPage.xaml.cs** file.
188190

189191
{% highlight c# tabtitle="C#" %}
190192

193+
using System.IO;
191194
using System.Text;
192195
using Syncfusion.SmartDataExtractor;
193196

@@ -203,13 +206,14 @@ Step 5: Add a new action method **OnExtractDataClicked** in MainPage.xaml.cs and
203206

204207
// Load the input PDF from the app package (include it in the project as a MauiAsset)
205208
using Stream inputStream = await FileSystem.OpenAppPackageFileAsync(Path.Combine("Data", "Input.pdf"));
206-
// Initialize Smart Data Extractor
209+
// Initialize the Data Extractor
207210
DataExtractor extractor = new DataExtractor();
208211
// Extract data as JSON string
209212
string data = extractor.ExtractDataAsJson(inputStream);
210213
// Save the extracted JSON data into an output file inside the application directory
211-
string outputPath = Path.Combine(Environment.CurrentDirectory, "Output", "Output.json");
212-
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
214+
string outputDirectory = Path.Combine(FileSystem.AppDataDirectory, "Output");
215+
Directory.CreateDirectory(outputDirectory);
216+
string outputPath = Path.Combine(outputDirectory, "Output.json");
213217
File.WriteAllText(outputPath, data, Encoding.UTF8);
214218
// Show success message
215219
await DisplayAlert("Success", $"Extracted data saved to {outputPath}", "OK");
@@ -230,4 +234,4 @@ By executing the program, you will get the JSON file as follows.
230234

231235
{% endtabcontent %}
232236

233-
{% endtabcontents %}
237+
{% endtabcontents %}

Document-Processing/Data-Extraction/NET/Extract-Data-in-WPF.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ In the project configuration window, name your project and select Create.
2323
Step 2: Install the [Syncfusion.SmartDataExtractor.WPF](https://www.nuget.org/packages/Syncfusion.SmartDataExtractor.WPF) NuGet package as a reference to your WPF application [NuGet.org](https://www.nuget.org/).
2424
![NuGet package installation](GettingStarted_images/WPF_DataExtractor_Nuget.png)
2525

26+
Add the input PDF file named **Input.pdf** to the project folder before running the sample.
2627

2728
Step 3: Include the following namespaces in the MainWindow.xaml.cs file.
2829

@@ -50,7 +51,7 @@ Step 4: Add a new button in MainWindow.xaml to extract data from a PDF document
5051

5152
{% endhighlight %}
5253

53-
Step 5: Add the following code in `ExtractButton_Click` to extract data from a PDF document using the **ExtractDataAsJson** method in the **DataExtractor** class. The extracted content will be saved as a JSON file
54+
Step 5: Add the following code in `ExtractButton_Click` to extract data from a PDF document using the [ExtractDataAsJson](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html#Syncfusion_SmartDataExtractor_DataExtractor_ExtractDataAsJson_System_IO_Stream_) method in the [DataExtractor](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html) class. The extracted content will be saved as a JSON file.
5455

5556
{% highlight c# tabtitle="C#" %}
5657

@@ -72,4 +73,4 @@ A complete working sample can be downloaded from [GitHub](https://github.com/Syn
7273
By executing the program, you will get the JSON file as follows.
7374
![WPF output JSON document](GettingStarted_images/JSON_Output.png)
7475

75-
Click [here](https://www.syncfusion.com/document-sdk/net-pdf-data-extraction) to explore the rich set of Syncfusion<sup>&reg;</sup>Data Extraction library features.
76+
Click [here](https://www.syncfusion.com/document-sdk/net-pdf-data-extraction) to explore the rich set of Syncfusion<sup>&reg;</sup> Data Extraction library features.

Document-Processing/Data-Extraction/NET/Extract-Data-in-Windows-Forms.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Step 3: Install [Syncfusion.SmartDataExtractor.WinForms](https://www.nuget.org/p
3333

3434
![Install Syncfusion.SmartDataExtractor.WinForms NuGet package](GettingStarted_images/Winforms_Nuget.png)
3535

36+
Add the input PDF file named **Input.pdf** to the Data folder before running the sample.
37+
3638
Step 4: Include the following namespaces in the **Form1.cs** file.
3739

3840
{% tabs %}
@@ -94,7 +96,7 @@ Step 6: Add the following code in **btnExtract_Click** to extract data from PDF.
9496
// Load the existing PDF document
9597
using (FileStream stream = new FileStream(Path.GetFullPath(@"../../Data/Input.pdf"), FileMode.Open, FileAccess.Read))
9698
{
97-
// Initialize the Smart Data Extractor
99+
// Initialize the Data Extractor
98100
DataExtractor extractor = new DataExtractor();
99101
// Extract data as JSON string
100102
string data = extractor.ExtractDataAsJson(stream);

0 commit comments

Comments
 (0)