Weekly Nuget Release
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md b/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md
index 9bece82ebc..7318c1edad 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md
@@ -7,66 +7,105 @@ documentation: UG
keywords: Assemblies
---
-# Perform OCR with AWS Textract
+# Perform OCR with AWS Textract
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports an external engine (AWS Textract) to process the OCR on image and PDF documents.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external OCR engines such as AWS Textract to process OCR on images and PDF documents.
-## Steps to perform OCR with AWS Textract
+## Prerequisites
-Step 1: Create a new .NET Console application project.
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- AWS subscription with Textract API access
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR with AWS Textract
+
+Step 1: Create a new .NET Console application project targeting **.NET Framework 4.6.2** or **.NET 8 or later**:

-In project configuration window, name your project and select Next.
+Step 2: In the project configuration window, name your project and select **Next**:

-Step 2: Install [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [AWSSDK.Textract](https://www.nuget.org/packages/AWSSDK.Textract) NuGet packages as reference to your .NET application from [nuget.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [AWSSDK.Textract](https://www.nuget.org/packages/AWSSDK.Textract) NuGet packages into your .NET application from [nuget.org](https://www.nuget.org/):


-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 3: Include the following namespaces in the Program.cs file.
+Step 4: Include the following namespaces in **Program.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
+
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
+
{% endhighlight %}
{% endtabs %}
-Step 4: Use the following code sample to perform OCR on a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with AWS Textract.
+Step 5: Use the following code sample to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with AWS Textract:
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Initialize the OCR processor.
+
+// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
- //Load an existing PDF document.
+ // Load an existing PDF document
FileStream stream = new FileStream("Region.pdf", FileMode.Open);
PdfLoadedDocument lDoc = new PdfLoadedDocument(stream);
- //Set the OCR language.
+ // Set the OCR language
processor.Settings.Language = Languages.English;
- //Initialize the AWS Textract external OCR engine.
- IOcrEngine azureOcrEngine = new AWSExternalOcrEngine();
- processor.ExternalEngine = azureOcrEngine;
- //Perform OCR with input document.
+ // Initialize the AWS Textract external OCR engine
+ IOcrEngine awsOcrEngine = new AWSExternalOcrEngine();
+ processor.ExternalEngine = awsOcrEngine;
+ // Perform OCR on the document
string text = processor.PerformOCR(lDoc);
- //Create file stream.
+ // Create file stream for output
FileStream fileStream = new FileStream("Output.pdf", FileMode.CreateNew);
- //Save the document into stream.
+ // Save the processed document
lDoc.Save(fileStream);
- //Close the document.
+ // Close the document and dispose streams
lDoc.Close();
stream.Dispose();
fileStream.Dispose();
}
+
{% endhighlight %}
{% endtabs %}
-Step 5: Create a new class named AWSExternalOcrEngine and implement the IOcrEngine interface. Get the image stream from the PerformOCR method and process it with an external OCR engine. This will return the OCRLayoutResult for the image.
+Step 6: Create a new class named **AWSExternalOcrEngine** that implements the **IOcrEngine** interface. Get the image stream from the PerformOCR method and process it with AWS Textract. This will return the **OCRLayoutResult** for the image:
-N> Provide a valid Secret Access Key to work with AWS Textract.
+N> Provide valid AWS Access Key ID and Secret Access Key to work with AWS Textract.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -77,16 +116,21 @@ class AWSExternalOcrEngine : IOcrEngine
private string awsSecretAccessKey = "SecretAccessKey";
private float imageHeight;
private float imageWidth;
+
public OCRLayoutResult PerformOCR(Stream stream)
{
+ // Authenticate with AWS Textract API
AmazonTextractClient clientText = Authenticate();
+ // Get OCR results from AWS Textract
DetectDocumentTextResponse textResponse = GetAWSTextractResult(clientText, stream).Result;
+ // Convert AWS Textract result to OCRLayoutResult format
OCRLayoutResult oCRLayoutResult = ConvertAWSTextractResultToOcrLayoutResult(textResponse);
return oCRLayoutResult;
}
public AmazonTextractClient Authenticate()
{
+ // Create AWS Textract client with credentials
AmazonTextractClient client = new AmazonTextractClient(awsAccessKeyId, awsSecretAccessKey, RegionEndpoint.USEast1);
return client;
}
@@ -95,11 +139,14 @@ class AWSExternalOcrEngine : IOcrEngine
{
stream.Position = 0;
MemoryStream memoryStream = new MemoryStream();
+ // Copy stream to memory stream
stream.CopyTo(memoryStream);
+ // Get image dimensions
PdfTiffImage bitmap = new PdfTiffImage(memoryStream);
imageHeight = bitmap.Height;
imageWidth = bitmap.Width;
+ // Call AWS Textract API to detect text
DetectDocumentTextResponse response = await client.DetectDocumentTextAsync(new DetectDocumentTextRequest
{
Document = new Document
@@ -118,19 +165,23 @@ class AWSExternalOcrEngine : IOcrEngine
Syncfusion.OCRProcessor.Word ocrWord;
layoutResult.ImageHeight = imageHeight;
layoutResult.ImageWidth = imageWidth;
+ // Process each block from AWS Textract response
foreach (var page in textResponse.Blocks)
{
ocrLine = new Line();
+ // Process only WORD blocks
if (page.BlockType == "WORD")
{
ocrWord = new Word();
ocrWord.Text = page.Text;
+ // Get bounding box coordinates from AWS Textract
float left = page.Geometry.BoundingBox.Left;
float top = page.Geometry.BoundingBox.Top;
float width = page.Geometry.BoundingBox.Width;
float height = page.Geometry.BoundingBox.Height;
- Rectangle rect = GetBoundingBox(left,top,width,height);
+ // Convert to rectangle bounds
+ Rectangle rect = GetBoundingBox(left, top, width, height);
ocrWord.Rectangle = rect;
ocrLine.Add(ocrWord);
ocrPage.Add(ocrLine);
@@ -139,13 +190,15 @@ class AWSExternalOcrEngine : IOcrEngine
layoutResult.Add(ocrPage);
return layoutResult;
}
+
public Rectangle GetBoundingBox(float left, float top, float width, float height)
{
+ // Convert relative coordinates to absolute pixel coordinates
int x = Convert.ToInt32(left * imageWidth);
int y = Convert.ToInt32(top * imageHeight);
int bboxWidth = Convert.ToInt32((width * imageWidth) + x);
int bboxHeight = Convert.ToInt32((height * imageHeight) + y);
- Rectangle rect = new Rectangle(x,y, bboxWidth, bboxHeight);
+ Rectangle rect = new Rectangle(x, y, bboxWidth, bboxHeight);
return rect;
}
}
@@ -153,7 +206,7 @@ class AWSExternalOcrEngine : IOcrEngine
{% endhighlight %}
{% endtabs %}
-By executing the program, you will get a PDF document as follows.
+By executing the program, you will obtain a PDF document with extracted text as follows:

-A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/AWS%20Textract).
\ No newline at end of file
+A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/AWS%20Textract).
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md
index 1b6385dd84..fc60dadff3 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md
@@ -9,23 +9,58 @@ keywords: Assemblies
# Perform OCR with Tesseract on Amazon Linux EC2 using .NET application
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Linux application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Linux applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
This guide provides a detailed, step-by-step process for installing Tesseract OCR and its essential dependencies directly on an Amazon Linux 2023 (AL2023) EC2 instance. This approach allows you to deploy .NET applications that utilize OCR functionalities, such as those relying on Syncfusion PDF Processing with Tesseract, without the need for Docker containers.
-## Pre-requisites
+## Prerequisites
-Before you begin, ensure you have:
+**Version Compatibility**
-* An active Amazon Linux 2023 (AL2023) EC2 instance.
-* SSH access to your EC2 instance.
-* Basic familiarity with Linux command-line operations.
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
-## Installation steps for .NET 8 and Tesseract OCR on Amazon Linux 2023 EC2
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR
+
+**Required Software**
+
+- - .NET 8 SDK or later
+- **Amazon Linux Version**: An active Amazon Linux 2023 (AL2023) EC2 instance
+- **Access**: SSH access to your EC2 instance
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+
+using Syncfusion.Licensing;
+
+protected void Application_Start()
+{
+ // Register the Syncfusion license
+ SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+}
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Installation steps for .NET 8 and Tesseract OCR on Amazon Linux 2023 EC2
Execute the following commands sequentially in your EC2 instance's terminal. It is recommended to run these commands from the `/home/ec2-user` directory unless specified otherwise.
-Step 1: **Update System Packages**: It's crucial to start by ensuring all existing packages on your EC2 instance are up to date
+Step 1: **Update System Packages** — It's crucial to start by ensuring all existing packages on your EC2 instance are up to date:
{% tabs %}
{% highlight bash %}
@@ -35,7 +70,7 @@ sudo yum update -y
{% endhighlight %}
{% endtabs %}
-Step 2: **Add Microsoft Package Repository** : To install the .NET SDK, you need to add the Microsoft package repository for Fedora 39, which AL2023 is based on.
+Step 2: **Add Microsoft Package Repository** — To install the .NET SDK, you need to add the Microsoft package repository for Fedora 39, which AL2023 is based on:
{% tabs %}
{% highlight bash %}
@@ -45,7 +80,7 @@ sudo curl -o /etc/yum.repos.d/packages-microsoft-com-prod.repo https://packages.
{% endhighlight %}
{% endtabs %}
-Step 3: **Install .NET SDK**: Install the .NET 8.0 SDK using yum. This is essential for building and running your .NET application.
+Step 3: **Install .NET SDK** — Install the .NET 8.0 SDK using yum. This is essential for building and running your .NET application:
{% tabs %}
{% highlight bash %}
@@ -55,7 +90,7 @@ sudo yum install -y dotnet-sdk-8.0
{% endhighlight %}
{% endtabs %}
-Step 4: **Verify .NET SDK Installation** : Confirm that the .NET SDK has been installed correctly by checking its version.
+Step 4: **Verify .NET SDK Installation** — Confirm that the .NET SDK has been installed correctly by checking its version:
{% tabs %}
{% highlight bash %}
@@ -67,7 +102,7 @@ sudo dotnet --version
You should see output similar to 8.0.x (where x is the patch version).
-Step 5: **Install `libgdiplus` Package** : `libgdiplus` is a Mono implementation of the GDI+ API, often required by .NET applications for image processing functionalities. Run these commands completely in a single block from the `/home/ec2-user` directory.
+Step 5: **Install `libgdiplus` Package** — `libgdiplus` is a Mono implementation of the GDI+ API, often required by .NET applications for image processing functionalities. Run these commands completely in a single block from the `/home/ec2-user` directory:
{% tabs %}
{% highlight bash %}
@@ -84,7 +119,7 @@ sudo make install
{% endhighlight %}
{% endtabs %}
-Step 6: **Install `leptonica` Package** : Leptonica is a software library that forms a core dependency for Tesseract OCR, providing image processing and analysis tools. Run these commands completely in a single block from the `/home/ec2-user` directory.
+Step 6: **Install `leptonica` Package** — Leptonica is a software library that forms a core dependency for Tesseract OCR, providing image processing and analysis tools. Run these commands completely in a single block from the `/home/ec2-user` directory:
{% tabs %}
{% highlight bash %}
@@ -102,7 +137,7 @@ sudo ldconfig
{% endhighlight %}
{% endtabs %}
-Step 7: **Install `libpng` Package** : `libpng` is the official PNG reference library, critical for handling PNG image formats often used in OCR processes. Although `libpng-devel` was installed, building from source ensures the correct version/setup sometimes.
+Step 7: **Install `libpng` Package** — `libpng` is the official PNG reference library, critical for handling PNG image formats often used in OCR processes. Although `libpng-devel` was installed, building from source ensures the correct version/setup:
{% tabs %}
{% highlight bash %}
@@ -121,7 +156,7 @@ sudo make install
{% endhighlight %}
{% endtabs %}
-Step 8: **Create Symbolic Link for libdl** : The .NET runtime often expects `libdl.so` to be directly accessible from its shared library path. You need to create a symbolic link from its actual location to the .NET runtime directory.
+Step 8: **Create Symbolic Link for libdl** — The .NET runtime often expects `libdl.so` to be directly accessible from its shared library path. You need to create a symbolic link from its actual location to the .NET runtime directory:
First, find the path of your installed .NET runtime version:
@@ -144,7 +179,7 @@ Microsoft.NETCore.App 8.0.x [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
{% endhighlight %}
{% endtabs %}
-Now, create the symbolic link. `Replace 8.0.17` with the exact version number from your `dotnet --list-` output for `Microsoft.NETCore.App`.
+Now, create the symbolic link. Replace `8.0.17` with the exact version number from your `dotnet --list-` output for `Microsoft.NETCore.App`:
{% tabs %}
{% highlight bash %}
@@ -154,9 +189,7 @@ sudo ln -s /usr/lib64/libdl.so.2 /usr/lib64/dotnet/shared/Microsoft.NETCore.App/
{% endhighlight %}
{% endtabs %}
-Step 9: Create Symbolic Link for `libpng16`
-
-Create a symbolic link for the `libpng16` package to ensure it's accessible in common library paths.
+Step 9: **Create Symbolic Link for `libpng16`** — Create a symbolic link for the `libpng16` package to ensure it's accessible in common library paths:
{% tabs %}
{% highlight bash %}
@@ -166,9 +199,7 @@ sudo ln -s /usr/local/lib/libpng16.so.16 /lib64/libpng16.so.16
{% endhighlight %}
{% endtabs %}
-Step 10: Create Symbolic Link for `liblept`
-
-Similarly, create a symbolic link for the `liblept` package (Leptonica library).
+Step 10: **Create Symbolic Link for `liblept`** — Similarly, create a symbolic link for the `liblept` package (Leptonica library):
{% tabs %}
{% highlight bash %}
@@ -178,9 +209,9 @@ sudo ln -s /usr/local/lib/liblept.so.5 /lib64/liblept.so.5
{% endhighlight %}
{% endtabs %}
-Step 11: **Implement the Project Code** : To set up your project's OCR functionality, consult the comprehensive guide on [Perform OCR in Linux](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/linux).
+Step 11: **Implement the Project Code** — To set up your project's OCR functionality, consult the comprehensive guide on [Perform OCR in Linux](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/linux).
-Step 12: **Set Permissions for Tesseract Binaries** : Navigate to your application's Tesseract binaries directory and set read, write, and execute permissions. This is crucial for the OCR process to function correctly. Important: You need to change `bin/Debug/net8.0/runtimes/linux/native` to the actual path where your Syncfusion Tesseract binaries (e.g., `libSyncfusionTesseract.so, liblept1753.so`) are located within your published application.
+Step 12: **Set Permissions for Tesseract Binaries** — Navigate to your application's Tesseract binaries directory and set read, write, and execute permissions. This is crucial for the OCR process to function correctly. Note: You need to change `bin/Debug/net8.0/runtimes/linux/native` to the actual path where your Syncfusion Tesseract binaries (e.g., `libSyncfusionTesseract.so`, `liblept1753.so`) are located within your published application:
{% tabs %}
{% highlight bash %}
@@ -191,17 +222,14 @@ sudo chmod 777 liblept1753.so
{% endhighlight %}
{% endtabs %}
-Step 13: **Build and Run Your .NET Application** : Finally, build and publish your .NET application, and then run it.
+Step 13: **Build and Run Your .NET Application** — Finally, build and publish your .NET application, and then run it:
{% tabs %}
{% highlight bash %}
sudo dotnet build
-
sudo dotnet publish -c Release -o ./publish
-
cd publish
-
sudo dotnet PdfProcessingApi.dll --urls "http://0.0.0.0:5000"
{% endhighlight %}
@@ -209,7 +237,7 @@ sudo dotnet PdfProcessingApi.dll --urls "http://0.0.0.0:5000"
Remember to replace `PdfProcessingApi.dll` with the actual name of your application's entry-point DLL.
-By executing the program, you will get the PDF document as follows. The output will be saved in parallel to the program.cs file.
+By executing the program, you will obtain a PDF document with extracted text as follows. The output will be saved in parallel to the **Program.cs** file:

-A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux).
\ No newline at end of file
+A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux).
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md
index 6e02345b22..c097b7f32c 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md
@@ -11,24 +11,61 @@ keywords: Assemblies
The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) can be integrated with external OCR engines like Azure Computer Vision and deployed on Azure Kubernetes Service (AKS) to efficiently process OCR tasks on images and PDF documents at scale.
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Docker installed on your system
+- Azure Kubernetes Service (AKS) cluster access
+- kubectl (Kubernetes CLI) installed
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
## Steps to perform OCR with Azure Kubernetes Service
-Step 1: Create a new ASP.NET Core application project.
+Step 1: Create a new ASP.NET Core application project targeting **.NET 8 or later**:

-Step 2: In the project configuration window, name your project and select Next.
+Step 2: In the project configuration window, name your project and select **Next**:

-Step 3: Enable the Docker support with Linux as a target OS.
+Step 3: Enable Docker support with **Linux** as the target OS:

-Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core application from [nuget.org](https://www.nuget.org/):

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 5: Include the following commands in the Docker file to install the dependent packages in the docker container.
+Step 5: Include the following commands in the **Dockerfile** to install the required system packages in the Docker container:
{% tabs %}
{% highlight bash %}
@@ -41,11 +78,11 @@ ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
{% endhighlight %}
{% endtabs %}
-
+
-Step 6: A default action method named Index will be present in the *HomeController.cs*. Right-click on the Index method and select Go to View, where you will be directed to its associated view page *Index.cshtml*.
+Step 6: A default action method named **Index** will be present in **HomeController.cs**. Right-click on the **Index** method and select **Go to View**, which will take you to the associated **Index.cshtml** view page:
-Step 7: Add a new button in the *index.cshtml* as follows.
+Step 7: Add a new button in **Index.cshtml** to trigger the OCR process:
{% tabs %}
{% highlight CSHTML %}
@@ -62,9 +99,9 @@ Step 7: Add a new button in the *index.cshtml* as follows.
{% endhighlight %}
{% endtabs %}
-
+
-Step 8: A default controller with the name *HomeController.cs* gets added to the creation of the ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
+Step 8: A default controller named **HomeController.cs** is added when you create the ASP.NET Core project. Include the following namespaces in **HomeController.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -75,32 +112,34 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 9: Add a new action method PerformOCR in the *HomeController.cs*, and include the code sample to perform OCR on the entire PDF document using `PerformOCR` method of the `OCRProcessor` class.
+Step 9: Add a new action method named **PerformOCR** in **HomeController.cs** to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
public ActionResult PerformOCR()
{
- string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf";
- //Initialize the OCR processor.
+ string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf";
+ // Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
FileStream fileStream = new FileStream(docPath, FileMode.Open, FileAccess.Read);
- //Load a PDF document
+ // Load a PDF document
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
- //Set OCR language to process
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Process OCR by providing the PDF document.
+ // Set Tesseract version (5.0 is bundled with v21.1.x+)
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Perform OCR on the document
processor.PerformOCR(lDoc);
- //Create memory stream
+ // Create memory stream
MemoryStream stream = new MemoryStream();
- //Save the document to memory stream
+ // Save the processed document to memory stream
lDoc.Save(stream);
lDoc.Close();
- //Set the position as '0'
+ // Reset stream position to ensure the file is not empty
stream.Position = 0;
- //Download the PDF document in the browser
+ // Download the PDF document in the browser
FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");
fileStreamResult.FileDownloadName = "Sample.pdf";
return fileStreamResult;
@@ -115,19 +154,15 @@ public ActionResult PerformOCR()
### Overview
This guide provides step-by-step instructions to deploy an application using Docker and Kubernetes. We'll tag a Docker image, push it to a repository, and apply Kubernetes configurations.
-### Prerequisites
-* Docker installed on your system
-* Access to a Kubernetes cluster
-* Kubernetes CLI (kubectl) installed
-
### Detailed Explanation of Docker Image Tagging
-Step 1: Tag the Docker image
+
+**Step 1: Tag the Docker image**
Tagging a Docker image is an essential step in Docker container management. It allows you to create an alias for a Docker image, making it easier to identify and manage. Tags are often used to denote different versions or environments (e.g., development, staging, production).
-1.Open your terminal. Ensure Docker is running on your system.
+1. Open your terminal and ensure Docker is running on your system.
-2.Run the tag command. Use the following syntax to tag your Docker image:
+2. Run the tag command using the following syntax:
{% tabs %}
{% highlight bash %}
@@ -137,25 +172,25 @@ docker tag :
{% endhighlight %}
{% endtabs %}
-
+
-Step 2: Push the Docker Image
+**Step 2: Push the Docker Image**
-Pushing uploads your tagged image to a Docker repository, making it accessible for deployment.
+Pushing uploads your tagged image into a Docker repository, making it accessible for deployment:
{% tabs %}
{% highlight bash %}
-docker push :
+docker push :
{% endhighlight %}
{% endtabs %}
-
+
-Step 3: Apply the deployment configuration
+**Step 3: Apply the deployment configuration**
-This step creates or updates your application's deployment configuration in your Kubernetes cluster.
+This step creates or updates your application's deployment configuration in your Kubernetes cluster:
{% tabs %}
{% highlight bash %}
@@ -165,12 +200,11 @@ kubectl apply -f deployment.yaml
{% endhighlight %}
{% endtabs %}
+
-
-
-Step 4: Apply the service configuration
+**Step 4: Apply the service configuration**
-Creating a service configuration exposes your application to the network, allowing external access.
+Creating a service configuration exposes your application to the network, allowing external access:
{% tabs %}
{% highlight bash %}
@@ -180,11 +214,11 @@ kubectl apply -f service.yaml
{% endhighlight %}
{% endtabs %}
-
+
-Step 5: Viewing service details
+**Step 5: View service details**
-Using **kubectl get service** allows you to check the services running in your Kubernetes cluster, ensuring they are correctly configured and accessible. You can copy the external IP and paste it into a browser like Chrome to view your application's output.
+Using **kubectl get service** allows you to check the services running in your Kubernetes cluster, ensuring they are correctly configured and accessible. You can copy the external IP and paste it into a browser like Chrome to view your application:
{% tabs %}
{% highlight bash %}
@@ -194,16 +228,16 @@ kubectl get service
{% endhighlight %}
{% endtabs %}
-
+
- Now be able to use this to browse the the web app running on AKS.
+Now you can use this to browse the web application running on AKS:
- 
+
- Click create PDF document to create a PDF document.You will get the output PDF document as follows.
+Click **Perform OCR on entire PDF** to create a PDF document with OCR text extraction. You will obtain the output PDF document as follows:
- 
+
- You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker).
+You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker).
- Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
+Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md
index aad5fc93f3..8a2473ae35 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md
@@ -7,58 +7,97 @@ documentation: UG
keywords: Assemblies
---
-# Perform OCR with Azure Vision
+# Perform OCR with Azure Vision
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external engines (Azure Computer Vision) to process the OCR on images and PDF documents.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external OCR engines such as Azure Computer Vision to process OCR on images and PDF documents.
-## Steps to perform OCR with Azure Computer Vision
-Step 1: Create a new .NET Console application project.
-
+## Prerequisites
-In project configuration window, name your project and select Next.
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Azure subscription with Computer Vision API access
+- Azure subscription key and endpoint
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR with Azure Computer Vision
+
+Step 1: Create a new .NET Console application project targeting **.NET Framework 4.6.2** or **.NET 8 or later**:
+
+
+Step 2: In the project configuration window, name your project and select **Next**:

-Step 2: Install [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [Microsoft.Azure.CognitiveServices.Vision.ComputerVision](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision) NuGet packages as reference to your .NET application from [nuget.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [Microsoft.Azure.CognitiveServices.Vision.ComputerVision](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision) NuGet packages into your application from [nuget.org](https://www.nuget.org/):


-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 3: Include the following namespaces in the Program.cs file.
+Step 4: Include the following namespaces in the **Program.cs** file:
{% tabs %}
{% highlight c# tabtitle="C#" %}
+
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
+
{% endhighlight %}
{% endtabs %}
-Step 4: Use the following code sample to perform OCR on a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with Azure Vision.
+Step 5: Use the following code sample to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with Azure Vision:
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Initialize the OCR processor.
+// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
- //Load an existing PDF document.
+ // Load an existing PDF document
FileStream stream = new FileStream("Input.pdf", FileMode.Open);
PdfLoadedDocument lDoc = new PdfLoadedDocument(stream);
- //Set OCR language.
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Initialize the Azure vision OCR external engine.
+ // Initialize the Azure Vision OCR external engine
IOcrEngine azureOcrEngine = new AzureExternalOcrEngine();
processor.ExternalEngine = azureOcrEngine;
- //Perform OCR.
+ // Perform OCR using Azure Vision
processor.PerformOCR(lDoc);
- //Create file stream.
+ // Create file stream for the output
FileStream outputStream = new FileStream("OCR.pdf", FileMode.CreateNew);
- //Save the document into stream.
+ // Save the document to the output stream
lDoc.Save(outputStream);
- //If the position is not set to '0' then the PDF will be empty.
+ // Reset stream position to ensure the file is not empty
outputStream.Position = 0;
- //Close the document.
+ // Close the document
lDoc.Close(true);
outputStream.Close();
}
@@ -66,9 +105,9 @@ using (OCRProcessor processor = new OCRProcessor())
{% endhighlight %}
{% endtabs %}
-Step 5: Create a new class named AzureExternalOcrEngine to get the image stream from the PerformOCR method and process the image stream with an external engine. It returns the OCRLayoutResult for the image.
+Step 6: Create a new class named **AzureExternalOcrEngine** to handle the image stream from the PerformOCR method and process it with Azure Computer Vision. It returns the **OCRLayoutResult** for the image:
-N> Provide a valid subscription key and endpoint to work with Azure computer vision.
+N> Provide a valid Azure subscription key and endpoint to work with Azure Computer Vision API.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -77,10 +116,14 @@ class AzureExternalOcrEngine : IOcrEngine
{
private string subscriptionKey = "SubscriptionKey";
private string endpoint = "Endpoint link";
+
public OCRLayoutResult PerformOCR(Stream imgStream)
{
+ // Authenticate with Azure Computer Vision API
ComputerVisionClient client = Authenticate();
+ // Read the image stream and get OCR results
ReadResult azureOcrResult = ReadFileUrl(client, imgStream).Result;
+ // Convert Azure OCR result to the OCRLayoutResult format
OCRLayoutResult result = ConvertAzureVisionOcrToOcrLayoutResult(azureOcrResult);
return result;
}
@@ -101,7 +144,7 @@ class AzureExternalOcrEngine : IOcrEngine
string operationLocation = textHeaders.OperationLocation;
const int numberOfCharsInOperationId = 36;
string operationId = operationLocation.Substring(operationLocation.Length - numberOfCharsInOperationId);
- //Extract the text
+ // Extract the text from Azure Vision results
ReadOperationResult results;
do
{
@@ -111,6 +154,7 @@ class AzureExternalOcrEngine : IOcrEngine
ReadResult azureOcrResult = results.AnalyzeResult.ReadResults[0];
return azureOcrResult;
}
+
private OCRLayoutResult ConvertAzureVisionOcrToOcrLayoutResult(ReadResult azureVisionOcr)
{
Syncfusion.OCRProcessor.Line ocrLine;
@@ -118,22 +162,19 @@ class AzureExternalOcrEngine : IOcrEngine
OCRLayoutResult ocrlayoutResult = new OCRLayoutResult();
ocrlayoutResult.ImageWidth = (float)azureVisionOcr.Width;
ocrlayoutResult.ImageHeight = (float)azureVisionOcr.Height;
- //Page
+ // Create page from Azure OCR result
Syncfusion.OCRProcessor.Page normalPage = new Syncfusion.OCRProcessor.Page();
- //Lines
+ // Process lines from Azure OCR result
foreach (var line in azureVisionOcr.Lines)
{
ocrLine = new Syncfusion.OCRProcessor.Line();
- //Word
+ // Process words in each line
foreach (var word in line.Words)
{
ocrWord = new Syncfusion.OCRProcessor.Word();
-
Rectangle rect = GetAzureVisionBounds(word.BoundingBox);
-
ocrWord.Text = word.Text;
ocrWord.Rectangle = rect;
-
ocrLine.Add(ocrWord);
}
normalPage.Add(ocrLine);
@@ -147,6 +188,7 @@ class AzureExternalOcrEngine : IOcrEngine
Rectangle rect = Rectangle.Empty;
PointF[] pointCollection = new PointF[bbox.Count / 2];
int count = 0;
+ // Convert Azure bounding box points to PointF array
for (int i = 0; i < bbox.Count; i = i + 2)
{
pointCollection[count] = new PointF((float)bbox[i], (float)bbox[i + 1]);
@@ -189,9 +231,9 @@ class AzureExternalOcrEngine : IOcrEngine
{% endhighlight %}
{% endtabs %}
-By executing the program, you will get a PDF document as follows.
-
+By executing the program, you will obtain a PDF document with extracted text as follows:
+
-A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure%20Vision).
+A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure%20Vision).
-Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
+Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md
index e15674bf13..135bc87bbd 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md
@@ -8,33 +8,66 @@ documentation: UG
# Perform OCR in Console Application
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Steps to perform OCR on the entire PDF document in Console application
+## Prerequisites
-{% tabcontents %}
+**Version Compatibility**
-{% tabcontent Visual Studio %}
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Visual Studio, Visual Studio Code, or JetBrains Rider
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
-**Prerequisites**:
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR on an entire PDF document in Console application
-* 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).
-* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
+{% tabcontents %}
+
+{% tabcontent Visual Studio %}
-Step 1: Create a new .NET Core console application project.
+Step 1: Create a new .NET console application project targeting **.NET 8.0**.

-Step 2: In configuration windows, name your project and select Next.
+Step 2: In the project configuration window, name your project and select **Next**, then select the target framework (.NET 6 or later) and click **Create**.


-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your console application from [NuGet.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
-Step 4: Include the following namespaces in the *Program.cs*.
+Step 4: Include the following namespaces in **Program.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -45,23 +78,25 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 5: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 5: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Initialize the OCR processor.
+// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
- //Load an existing PDF document.
+ // Load an existing PDF document
PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf"));
- //Set OCR language.
+ // Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Perform OCR with input document and tessdata (Language packs).
+ // Perform OCR on the document
processor.PerformOCR(document);
- //Save the PDF document.
+ // Save the processed PDF to disk
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
- //Close the document.
+ // Close the document
document.Close(true);
}
@@ -74,39 +109,33 @@ Click the **Build** button in the toolbar or press Ctrl+ShiftF5 to run the app.
+Click the **Run** button (green arrow) in the toolbar or press F5 to run the application.
{% endtabcontent %}
{% tabcontent Visual Studio Code %}
-**Prerequisites**:
-
-* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://code.visualstudio.com/download?_exp_download=d53503e735).
-* Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
-* Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
-
-Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new Console Application project.
+Step 1: Open the terminal (Ctrl+`) and run the following command to create a new console application project targeting **.NET 8 or later**:
```
-dotnet new console -n ConsoleApplication
+dotnet new console -n ConsoleApplication --framework net8.0
```
-Step 2: Replace ****ConsoleApplication** with your desired project name.
-Step 3: Navigate to the project directory using the following command
+Step 2: Replace **ConsoleApplication** with your desired project name.
+
+Step 3: Navigate to the project directory:
```
cd ConsoleApplication
```
-Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project.
+
+Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package:
```
dotnet add package Syncfusion.PDF.OCR.Net.Core
```
-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-Step 5: Include the following namespaces in the *Program.cs*.
+Step 5: Include the following namespaces in **Program.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -117,23 +146,25 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 6: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 6: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Initialize the OCR processor.
+// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
- //Load an existing PDF document.
+ // Load an existing PDF document
PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf"));
- //Set OCR language.
+ // Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Perform OCR with input document and tessdata (Language packs).
+ // Perform OCR on the document
processor.PerformOCR(document);
- //Save the PDF document.
+ // Save the processed PDF to disk
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
- //Close the document.
+ // Close the document
document.Close(true);
}
@@ -142,7 +173,7 @@ using (OCRProcessor processor = new OCRProcessor())
Step 7: Build the project.
-Run the following command in terminal to build the project.
+Run the following command in terminal to build the project:
```
dotnet build
@@ -150,7 +181,7 @@ dotnet build
Step 8: Run the project.
-Run the following command in terminal to build the project.
+Run the following command in terminal to run the application:
```
dotnet run
@@ -158,38 +189,30 @@ dotnet run
{% endtabcontent %}
-{% tabcontent JetBrains Raider %}
+{% tabcontent JetBrains Rider %}
-**Prerequisites:**
-
-* JetBrains Rider.
-* Install .NET 8 SDK or later.
-
-Step 1. Open JetBrains Rider and create a new .NET Core console application project.
-* Launch JetBrains Rider.
-* Click new solution on the welcome screen.
+Step 1: Open JetBrains Rider and create a new .NET console application project:
+- Launch JetBrains Rider
+- Click **New Solution** on the welcome screen

-* In the new Solution dialog, select Project Type as Console.
-* Enter a project name and specify the location.
-* Select the target framework (e.g., .NET 8.0, .NET 9.0 or .NET 10.0).
-* Click create.
+- In the new Solution dialog, select **Console** as the Project Type
+- Enter a project name and specify the location
+- Select the target framework(e.g., .NET 8.0, .NET 9.0 and .NET 10).
+- Click **Create**

-Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/).
-* Click the NuGet icon in the Rider toolbar and type [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) in the search bar.
-* Ensure that "NuGet.org" is selected as the package source.
-* Select the latest Syncfusion.PDF.OCR.Net.Core NuGet package from the list.
-* Click the + (Add) button to add the package.
+Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/):
+- Click the **NuGet** icon in the Rider toolbar and search for [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core)
+- Ensure **NuGet.org** is selected as the package source
+- Select the latest Syncfusion.PDF.OCR.Net.Core package from the list
+- Click the **+** (Add) button to add the package

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 3: Include the following namespaces in the *Program.cs*.
+Step 3: Include the following namespaces in **Program.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -200,23 +223,25 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 4: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 4: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Initialize the OCR processor.
+// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
- //Load an existing PDF document.
+ // Load an existing PDF document
PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf"));
- //Set OCR language.
+ // Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Perform OCR with input document and tessdata (Language packs).
+ // Perform OCR on the document
processor.PerformOCR(document);
- //Save the PDF document.
+ // Save the processed PDF to disk
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
- //Close the document.
+ // Close the document
document.Close(true);
}
@@ -229,13 +254,13 @@ Click the **Build** button in the toolbar or press Ctrl+ShiftF5 to run the app.
+Click the **Run** button (green arrow) in the toolbar or press F5 to run the application.
{% endtabcontent %}
{% endtabcontents %}
-By executing the program, you will get the PDF document as follows
+By executing the program, you will get a PDF document with extracted text as shown below:

A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Console).
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md
index b144503141..5559110c21 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md
@@ -8,25 +8,61 @@ keywords: Assemblies
---
# Perform OCR in Docker
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from the scanned PDFs and images in the Docker application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Docker applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Docker installed and running
+- Linux container image (typically Ubuntu)
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
## Steps to perform OCR on entire PDF document in Docker
-Step 1: Create a new ASP.NET Core application project.
+Step 1: Create a new ASP.NET Core application project targeting **.NET 8.0 or later**.

-Step 2: In the project configuration window, name your project and select Next.
+Step 2: In the project configuration window, name your project and select **Next**.

-Step 3: Enable the Docker support with Linux as a target OS.
+Step 3: Enable Docker support with **Linux** as the target OS.

-Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your .NET applications from [NuGet.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 5: Include the following commands in the Docker file to install the dependent packages in the docker container.
+Step 5: Include the following commands in the **Dockerfile** to install the required system packages:
{% tabs %}
{% highlight bash %}
@@ -40,11 +76,11 @@ RUN ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
{% endhighlight %}
{% endtabs %}
-
+
-Step 6: A default action method named Index will be present in the *HomeController.cs*. Right-click on the Index method and select Go to View, where you will be directed to its associated view page *Index.cshtml*.
+Step 6: A default action method named **Index** is present in **HomeController.cs**. Right-click on the **Index** method and select **Go to View** to navigate to its associated view page **Index.cshtml**.
-Step 7: Add a new button in the *index.cshtml* as follows.
+Step 7: Add a new button in **Index.cshtml** as follows:
{% tabs %}
{% highlight CSHTML %}
@@ -63,7 +99,7 @@ Step 7: Add a new button in the *index.cshtml* as follows.

-Step 8: A default controller with the name *HomeController.cs* gets added to the creation of the ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
+Step 8: A default controller named **HomeController.cs** is added when you create an ASP.NET Core project. Include the following namespaces in **HomeController.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -74,34 +110,34 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 9: Add a new action method PerformOCR in the *HomeController.cs*, and include the code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 9: Add a new action method **PerformOCR** in **HomeController.cs** to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
public ActionResult PerformOCR()
{
- string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf";
- //Initialize the OCR processor.
+ string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf";
+ // Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
{
FileStream fileStream = new FileStream(docPath, FileMode.Open, FileAccess.Read);
- //Load a PDF document
+ // Load a PDF document
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
- //Set OCR language to process
+ // Set the OCR language
processor.Settings.Language = Languages.English;
- //Process OCR by providing the PDF document.
+ // Set Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Process OCR on the PDF document
processor.PerformOCR(lDoc);
- //Create memory stream
+ // Create memory stream and save the processed document
MemoryStream stream = new MemoryStream();
- //Save the document to memory stream
lDoc.Save(stream);
lDoc.Close();
- //Set the position as '0'
+ // Set the position to 0 and return as file download
stream.Position = 0;
- //Download the PDF document in the browser
FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");
- fileStreamResult.FileDownloadName = "Sample.pdf";
+ fileStreamResult.FileDownloadName = "Output.pdf";
return fileStreamResult;
}
}
@@ -109,12 +145,12 @@ public ActionResult PerformOCR()
{% endhighlight %}
{% endtabs %}
-Step 10: Build and run the sample in Docker. It will pull the Linux Docker image from the Docker hub and run the project. Now, the webpage will open in the browser. Click the button to convert the webpage to a PDF.
+Step 10: Build and run the application in Docker. It will pull the Linux Docker image and run the project. The webpage will open in your browser. Click the button to perform OCR on the PDF document.
-By executing the program, you will get a PDF document as follows.
+By executing the program, you will get a PDF document with extracted text as shown below:
-
+
-A complete working sample for converting an HTML to PDF in the Linux docker container can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker).
+A complete working sample for performing OCR in a Docker container can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker).
Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md
index b030eca489..3f4bece96c 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md
@@ -9,10 +9,49 @@ keywords: Assemblies
# Perform OCR in Linux
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Linux application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Pre-requisites
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in .NET console applications on Linux with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-The following Linux dependencies should be installed where the conversion takes place.
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8.0 or later version
+- Linux x86_64 architecture
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+**Linux Dependencies**
+
+The following Linux system dependencies should be installed where the OCR processing takes place:
{% tabs %}
{% highlight bash %}
@@ -27,10 +66,9 @@ ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
{% endhighlight %}
{% endtabs %}
+## Steps to perform OCR on an entire PDF document on Linux
-## Steps to convert HTML to PDF in .NET Core application on Linux
-
-Step 1: Execute the following command in the Linux terminal to create a new .NET Core Console application.
+Step 1: Execute the following command in the Linux terminal to create a new .NET Core Console application:
{% tabs %}
{% highlight bash %}
@@ -42,19 +80,19 @@ dotnet new console

-Step 2: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Core application [NuGet.org](https://www.nuget.org/).
+Step 2: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your .NET Core application from [NuGet.org](https://www.nuget.org/):
{% tabs %}
{% highlight bash %}
-dotnet add package Syncfusion.PDF.OCR.Net.Core -v xx.x.x.xx -s https://www.nuget.org/
+dotnet add package Syncfusion.PDF.OCR.Net.Core
{% endhighlight %}
{% endtabs %}

-Step 3: Include the following namespaces in Program.cs file.
+Step 3: Include the following namespaces in **Program.cs** file.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -66,14 +104,12 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-N> Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-
-Step 4: Add code sample to perform OCR on entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 4: Add the following code sample to perform OCR on an entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
{% tabs %}
{% highlight c# tabtitle="C#" %}
-string docPath = ("input.pdf");
+string docPath = "Input.pdf";
//Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor())
@@ -81,35 +117,23 @@ using (OCRProcessor processor = new OCRProcessor())
//Load the PDF document
FileStream stream = new FileStream(docPath, FileMode.Open, FileAccess.Read);
PdfLoadedDocument lDoc = new PdfLoadedDocument(stream);
-
- //Language to process the OCR
+ //Set the Tesseract version.
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ //Set OCR language to process.
processor.Settings.Language = Languages.English;
- //Process OCR by providing loaded PDF document, Data dictionary and language
+ //Process OCR by providing the PDF document.
processor.PerformOCR(lDoc);
-
- //Save the OCR processed PDF document in the disk
- MemoryStream streamData = new MemoryStream();
- lDoc.Save(streamData);
- File.WriteAllBytes("Output.pdf", streamData.ToArray());
+ //Save the OCR processed PDF document to disk.
+ lDoc.Save("Output.pdf");
lDoc.Close(true);
+ stream.Dispose();
+ Console.WriteLine("OCR processing completed successfully!");
}
{% endhighlight %}
{% endtabs %}
-Step 5: Execute the following command to restore the NuGet packages.
-
-{% tabs %}
-{% highlight bash %}
-
-dotnet restore
-
-{% endhighlight %}
-{% endtabs %}
-
-
-
-Step 6: Execute the following command in the terminal to build the application.
+Step 5: Execute the following command to build the application:
{% tabs %}
{% highlight bash %}
@@ -119,9 +143,9 @@ dotnet build
{% endhighlight %}
{% endtabs %}
-
+
-Step 7: Execute the following command in the terminal to run the application.
+Step 6: Execute the following command in the terminal to run the application:
{% tabs %}
{% highlight bash %}
@@ -131,9 +155,9 @@ dotnet run
{% endhighlight %}
{% endtabs %}
-
+
-By executing the program, you will get the PDF document as follows. The output will be saved in parallel to the program.cs file.
+By executing the program, you will get a PDF document with extracted text. The output will be saved in the same directory as the executable:

A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux).
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md b/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md
index 8c56c29d1d..596fe3b556 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md
@@ -1,6 +1,6 @@
---
-title: Perform OCR on PDF and Image Files in Mac | Syncfusion
-description: Learn how to perform OCR on scanned PDF documents and images in WPF with different Tesseract versions using Syncfusion .NET OCR library.
+title: Perform OCR on PDF and Image Files in macOS | Syncfusion
+description: Learn how to perform OCR on scanned PDF documents and images in macOS with different Tesseract versions using Syncfusion .NET OCR library.
platform: document-processing
control: PDF
documentation: UG
@@ -9,30 +9,61 @@ keywords: Assemblies
# Perform OCR on macOS
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) used to extract text from scanned PDFs and images in the Mac application.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in .NET console applications on macOS with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Steps to perform OCR on entire PDF document in Mac
+## Prerequisites
-{% tabcontents %}
+**Version Compatibility**
-{% tabcontent Visual Studio %}
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Visual Studio or Visual Studio Code
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
-**Prerequisites**:
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
-* 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).
-* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR on an entire PDF document on macOS
+
+{% tabcontents %}
+
+{% tabcontent Visual Studio %}
Step 1: Create a new .NET Core console application project.

-Step 2: Select the project version.
+Step 2: Select your target framework (.NET 8.0 or later).
-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your project from [NuGet.org](https://www.nuget.org/).

-N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about registering the Syncfusion® license key in your application to use our components.
-
-Step 4: Include the following Namespaces in the Program.cs file.
+Step 4: Include the following namespaces in the **Program.cs** file.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -43,7 +74,7 @@ using Syncfusion.Pdf.Parsing;
{% endtabs %}
-Step 5: Add the following code sample to the *Program.cs* file to **Perform OCR in .NET Core application on Mac OS**.
+Step 5: Add the following code sample to the **Program.cs** file to perform OCR on a PDF document.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -54,21 +85,17 @@ using (OCRProcessor processor = new OCRProcessor())
FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
//Load a PDF document.
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
+ //Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
//Set the OCR language to be processed.
processor.Settings.Language = Languages.English;
//Process OCR by providing the PDF document.
processor.PerformOCR(lDoc);
- //Create memory stream.
- MemoryStream stream = new MemoryStream();
- //Save the document to the memory stream.
- lDoc.Save(stream);
+ //Save the document to disk.
+ lDoc.Save("OCR.pdf");
lDoc.Close();
- //Set the position as '0'.
- stream.Position = 0;
- //Download the PDF document in the browser.
- FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");
- fileStreamResult.FileDownloadName = "OCR.pdf";
- return fileStreamResult;
+ fileStream.Dispose();
+ Console.WriteLine("OCR processing completed successfully!");
}
{% endhighlight %}
@@ -77,42 +104,37 @@ using (OCRProcessor processor = new OCRProcessor())
Step 6: Build the project.
-Click on Build > Build Solution or press Ctrl + Shift + B to build the project.
+Click **Build > Build Solution** or press Ctrl+Shift+B to build the project.
Step 7: Run the project.
-Click the Start button (green arrow) or press F5 to run the app.
+Click the **Start** button (green arrow) or press F5 to run the app.
{% endtabcontent %}
{% tabcontent Visual Studio Code %}
-**Prerequisites**:
-
-* 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).
-* Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
-* Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
-
-Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new .NET Core console application project.
+Step 1: Open the terminal (Ctrl+`) and run the following command to create a new .NET Core console application project:
```
dotnet new console -n CreatePdfMacOSApp
```
-Step 2: Replace **CreatePdfMacOSApp** with your desired project name.
-Step 3: Navigate to the project directory using the following command
+Step 2: Replace `CreatePdfMacOSApp` with your desired project name.
+
+Step 3: Navigate to the project directory using the following command:
```
cd CreatePdfMacOSApp
```
-Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project.
+
+Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project:
```
dotnet add package Syncfusion.PDF.OCR.Net.Core
```
-N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about registering the Syncfusion® license key in your application to use our components.
-Step 5: Include the following Namespaces in the Program.cs file.
+Step 5: Include the following namespaces in the **Program.cs** file.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -123,7 +145,7 @@ using Syncfusion.Pdf.Parsing;
{% endtabs %}
-Step 6: Add the following code sample to the *Program.cs* file to **Perform OCR in .NET Core application on Mac OS**.
+Step 6: Add the following code sample to the **Program.cs** file to perform OCR on a PDF document.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -134,21 +156,17 @@ using (OCRProcessor processor = new OCRProcessor())
FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
//Load a PDF document.
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
+ //Set the Tesseract version.
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
//Set the OCR language to be processed.
processor.Settings.Language = Languages.English;
//Process OCR by providing the PDF document.
processor.PerformOCR(lDoc);
- //Create memory stream.
- MemoryStream stream = new MemoryStream();
- //Save the document to the memory stream.
- lDoc.Save(stream);
+ //Save the document to disk.
+ lDoc.Save("OCR.pdf");
lDoc.Close();
- //Set the position as '0'.
- stream.Position = 0;
- //Download the PDF document in the browser.
- FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");
- fileStreamResult.FileDownloadName = "OCR.pdf";
- return fileStreamResult;
+ fileStream.Dispose();
+ Console.WriteLine("OCR processing completed successfully!");
}
{% endhighlight %}
@@ -157,7 +175,7 @@ using (OCRProcessor processor = new OCRProcessor())
Step 7: Build the project.
-Run the following command in terminal to build the project.
+Run the following command in the terminal to build the project:
```
dotnet build
@@ -165,7 +183,7 @@ dotnet build
Step 8: Run the project.
-Run the following command in terminal to build the project.
+Run the following command in the terminal to run the project:
```
dotnet run
@@ -174,7 +192,7 @@ dotnet run
{% endtabcontents %}
-By executing the program, you will get a PDF document as follows.
+By executing the program, you will get a PDF document with extracted text as follows.

A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Mac).
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md b/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md
index 87bf25a9c7..4d76456e0b 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md
@@ -9,22 +9,55 @@ keywords: Assemblies
# Perform OCR in WPF (Windows Presentation Foundation)
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) used to extract text from scanned PDFs and images in the WPF application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in WPF applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Steps to perform OCR on entire PDF document in WPF
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.Pdf.OCR.WPF supports WPF applications targeting .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later versions
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the "Syncfusion.Licensing" assembly reference and register a license key in your application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) for details on registering a Syncfusion® license key.
+
+To register the license key, add the following code to your **App.xaml.cs** file at the beginning of the `App` constructor:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+
+using Syncfusion.Licensing;
+
+public partial class App : Application
+{
+ public App()
+ {
+ SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
+ }
+}
+
+{% endhighlight %}
+{% endtabs %}
+
+## Steps to perform OCR on an entire PDF document in WPF
Step 1: Create a new WPF application project.

-In project configuration window, name your project and select Create.
+In the project configuration window, select your target framework (.NET Framework 4.6.2 or later), name your project, and select **Create**.

-Step 2: Install the [Syncfusion.Pdf.OCR.Wpf](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.Wpf) NuGet package as a reference to your WPF application from [nuget.org](https://www.nuget.org/).
+Step 2: Install the [Syncfusion.Pdf.OCR.Wpf](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.Wpf) NuGet package into your WPF application from [nuget.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
Step 3: Add a new button in **MainWindow.xaml** to perform OCR as follows.
{% tabs %}
@@ -37,18 +70,21 @@ Step 3: Add a new button in **MainWindow.xaml** to perform OCR as follows.
{% endhighlight %}
{% endtabs %}
-Step 6: Include the following namespaces in the **MainWindow.xaml.cs** file.
+Step 4: Build the project to ensure the XAML compiles and generates the code-behind properly. Press **Ctrl+Shift+B** or go to **Build > Build Solution**.
+
+Step 5: Include the following namespaces in the **MainWindow.xaml.cs** file.
{% tabs %}
{% highlight c# tabtitle="C#" %}
+using System.Windows;
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 4: Add the following code to a Button_Click to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 6: Add the following code to the `Button_Click` event handler to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -59,18 +95,17 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
//Load an existing PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
- //Set the tesseract version.
- processor.Settings.TesseractVersion = TesseractVersion.Version4_0;
+ //Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
//Set OCR language to process.
processor.Settings.Language = Languages.English;
//Process OCR by providing the PDF document.
- processor.PerformOCR(loadedDocument);
- //Save the OCR processed PDF document in the disk.
+ processor.PerformOCR(loadedDocument);
+ //Save the OCR processed PDF document to disk.
loadedDocument.Save("OCR.pdf");
loadedDocument.Close(true);
}
}
-
{% endhighlight %}
{% endtabs %}
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md
index bd113b8678..9ed2178860 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md
@@ -9,28 +9,60 @@ keywords: pdf, core, web api, csharp
# Perform OCR in ASP.NET Core Web API
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET Core Web API applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-To include the .NET OCR library in your ASP.NET Core Web API, please refer to the [NuGet Package](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/nuget-packages-required) Required' or [Assemblies Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/assemblies-required) documentation.
+To include the .NET OCR library in your ASP.NET Core Web API, please refer to the [NuGet Packages Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/nuget-packages-required) or [Assemblies Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/assemblies-required) documentation.
-## Steps to perform OCR on the entire PDF document in ASP.NET Core Web API
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR on an entire PDF document in ASP.NET Core Web API
Step 1: Create a new C# ASP.NET Core Web API project.

-Step 2: In the project configuration windows, name your project and click Create.
+Step 2: In the project configuration window, select your target framework (.NET 8.0 or later), name your project, and click **Create**.

-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core Web API project from [NuGet.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
+Step 4: Build the project to ensure all NuGet packages are properly restored. Press **Ctrl+Shift+B** or go to **Build > Build Solution**.
-Step 4: Add a new API controller empty file in the project.
+Step 5: Add a new API controller empty file in the project.

-Step 5: Include the following namespaces in the *PdfController.cs*.
+Step 6: Include the following namespaces in the *PdfController.cs*.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -41,7 +73,7 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 6: Include the following code sample in *PdfController.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 7: Include the following code sample in *PdfController.cs* using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -49,28 +81,36 @@ Step 6: Include the following code sample in *PdfController.cs* using [PerformOC
[HttpGet("/api/Pdf")]
public IActionResult ConvertOCR()
{
- FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
- //Load an existing PDF document.
- PdfLoadedDocument document = new PdfLoadedDocument(fileStream);
- //Set OCR language.
- processor.Settings.Language = Languages.English;
- //Perform OCR with input document and tessdata (Language packs).
- processor.PerformOCR(document);
- //Create memory stream.
- MemoryStream stream = new MemoryStream();
- //Save the document to memory stream.
- document.Save(stream);
- stream.Position = 0;
- return File(stream, "application/pdf", "Output.pdf");
+ //Initialize the OCR processor.
+ using (OCRProcessor processor = new OCRProcessor())
+ {
+ FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
+ //Load an existing PDF document.
+ PdfLoadedDocument document = new PdfLoadedDocument(fileStream);
+ //Set the Tesseract version.
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ //Set OCR language.
+ processor.Settings.Language = Languages.English;
+ //Perform OCR with input document and tessdata (Language packs).
+ processor.PerformOCR(document);
+ //Create memory stream.
+ MemoryStream stream = new MemoryStream();
+ //Save the document to memory stream.
+ document.Save(stream);
+ stream.Position = 0;
+ fileStream.Dispose();
+ document.Dispose();
+ return File(stream, "application/pdf", "Output.pdf");
+ }
}
{% endhighlight %}
{% endtabs %}
-Step 7: Navigate to the `Swagger UI`, expand the `GET /api/Pdf` API, click `Execute`, and then download the response output.
+Step 8: Navigate to the `Swagger UI`, expand the `GET /api/Pdf` API, click **Execute**, and then download the response output.

-By executing the program, you will get the PDF document as follows.
+By executing the program, you will get a PDF document with extracted text as follows.

A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Web%20API).
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md
index 7f258d0964..3d6286c86b 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md
@@ -6,23 +6,57 @@ documentation: UG
keywords: Assemblies
---
-# Perform OCR in Windows
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) used to extract text from scanned PDFs and images in Windows Forms application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+# Perform OCR in Windows Forms
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Windows Forms applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Steps to perform OCR on entire PDF document in Windows Forms
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.Pdf.OCR.WinForms supports .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the "Syncfusion.Licensing" assembly reference and register a license key in your application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) for details on registering a Syncfusion® license key.
+
+To register the license key, add the following code to your **Form1.cs** file at the beginning of the form's constructor or the Main method:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+
+using Syncfusion.Licensing;
+
+public Form1()
+{
+ InitializeComponent();
+ SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
+}
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR on an entire PDF document in Windows Forms
Step 1: Create a new Windows Forms application project.

-In project configuration window, name your project and select Create.
+In the project configuration window, select your target framework (.NET Framework 4.6.2 or later), name your project, and select **Create**.

-Step 2: Install the [Syncfusion.Pdf.OCR.WinForms](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.WinForms) NuGet package as a reference to your WinForms application from [nuget.org](https://www.nuget.org/).
+Step 2: Install the [Syncfusion.Pdf.OCR.WinForms](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.WinForms) NuGet package into your WinForms application from [nuget.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
Step 3: Add a new button in Form1.Designer.cs file.
{% tabs %}
@@ -78,18 +112,17 @@ private void btnCreate_Click(object sender, EventArgs e)
{
//Load an existing PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
- //Set the tesseract version
- processor.Settings.TesseractVersion = TesseractVersion.Version4_0;
+ //Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
//Set OCR language to process.
processor.Settings.Language = Languages.English;
//Process OCR by providing the PDF document.
processor.PerformOCR(loadedDocument);
- //Save the OCR processed PDF document in the disk.
+ //Save the OCR processed PDF document to disk.
loadedDocument.Save("OCR.pdf");
loadedDocument.Close(true);
}
}
-
{% endhighlight %}
{% endtabs %}
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md b/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md
index 52e9e1df01..42297b05c7 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md
@@ -9,24 +9,56 @@ keywords: Assemblies
# Perform OCR in ASP.NET MVC
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET MVC application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET MVC applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.Pdf.OCR.AspNet.Mvc5 supports Web applications targeting .NET Framework 4.6.2 and later.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Register the License Key**
+
+Include a license key in the **Global.asax.cs** file before creating an **OCRProcessor** instance. Refer to the [Syncfusion License](https://help.syncfusion.com/common/essential-studio/licensing/overview) documentation to learn about registering the Syncfusion license key in your application.
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+
+using Syncfusion.Licensing;
+
+protected void Application_Start()
+{
+ // Register the Syncfusion license
+ SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+}
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
## Steps to perform OCR on entire PDF document in ASP.NET MVC
-Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project.
+Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project targeting **.NET Framework 4.6.2** or **later**:

-Step 2: In the project configuration windows, name your project and click Create.
+Step 2: In the project configuration window, name your project and click **Create**:


-Step 3: Install the [Syncfusion.Pdf.OCR.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.AspNet.Mvc5) NuGet package as a reference to your .NET applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.Pdf.OCR.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.AspNet.Mvc5) NuGet package into your .NET application from [NuGet.org](https://www.nuget.org/):

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 4: Include the following namespaces in the HomeController.cs file.
+Step 4: Include the following namespaces in the **HomeController.cs** file:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -37,7 +69,7 @@ using Syncfusion.Pdf.Parsing;
{% endhighlight %}
{% endtabs %}
-Step 5: Add a new button in the *Index.cshtml* as follows.
+Step 5: Add a new button in the **Index.cshtml** as follows:
{% tabs %}
{% highlight CSHTML %}
@@ -54,38 +86,40 @@ Step 5: Add a new button in the *Index.cshtml* as follows.
{% endhighlight %}
{% endtabs %}
-Step 6: Add a new action method named PerformOCR in the HomeController.cs file and use the following code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 6: Add a new action method named **PerformOCR** in the **HomeController.cs** file and use the following code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
+
public ActionResult PerformOCR()
{
- //Initialize the OCR processor.
- using (OCRProcessor processor = new OCRProcessor())
- {
- FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
- //Load a PDF document.
- PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
- //Set OCR language to process.
- processor.Settings.Language = Languages.English;
- processor.Settings.TesseractVersion = TesseractVersion.Version3_05;
- //Process OCR by providing the PDF document.
- processor.PerformOCR(lDoc);
- //Open the document in browser after saving it.
- lDoc.Save("Output.pdf", HttpContext.ApplicationInstance.Response, Syncfusion.Pdf.HttpReadType.Save);
- //Close the document.
- lDoc.Close(true);
- }
- return View();
+ // Initialize the OCR processor
+ using (OCRProcessor processor = new OCRProcessor())
+ {
+ // Open the input PDF document
+ FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
+ // Load the PDF document
+ PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
+ // Set the OCR language
+ processor.Settings.Language = Languages.English;
+ // Set the Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Perform OCR on the document
+ processor.PerformOCR(lDoc);
+ // Save and download the processed document to the browser
+ lDoc.Save("Output.pdf", HttpContext.ApplicationInstance.Response, Syncfusion.Pdf.HttpReadType.Save);
+ // Close and dispose the document
+ lDoc.Close(true);
+ }
+ return View();
}
{% endhighlight %}
{% endtabs %}
-By executing the program, you will get a PDF document as follows.
+By executing the program, you will obtain a PDF document with extracted text as follows:

-A complete working sample can be downloaded from the [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/ASP.NET%20MVC).
+A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/ASP.NET%20MVC).
-Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
-
\ No newline at end of file
+Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md b/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md
index 4d4c4e689e..cdb911d3c2 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md
@@ -11,24 +11,59 @@ keywords: Assemblies
The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Azure with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+## Prerequisites
+
+**Version Compatibility**
+
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Azure subscription with Azure App Service or Azure Functions
+
+**Register the License Key**
+
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
+
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
+
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
## Azure App Service Windows
-### Steps to perform OCR on entire PDF document in Azure App Service
+### Steps to perform OCR on an entire PDF document in Azure App Service
-Step 1: Create a new ASP.NET Core MVC application.
-
+Step 1: Create a new ASP.NET Core MVC application targeting **.NET 8 or later**:
+
-Step 2: In configuration windows, name your project and click Next.
-
-
+Step 2: In the configuration window, name your project and click **Next**:
+
+
-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core application from [nuget.org](https://www.nuget.org/):

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 4: Add a new button in index.cshtml as follows.
+Step 4: Add a new button in **Index.cshtml** to trigger the OCR process:
{% tabs %}
{% highlight CSHTML %}
@@ -47,34 +82,36 @@ Step 4: Add a new button in index.cshtml as follows.
{% endhighlight %}
{% endtabs %}
-Step 5: Include the following namespaces in the HomeController.cs file.
+Step 5: Include the following namespaces in **HomeController.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
-using Microsoft.AspNetCore.Hosting.IHostingEnvironment;
+using Microsoft.AspNetCore.Hosting;
{% endhighlight %}
{% endtabs %}
-Step 6: Add the code samples for performing OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class.
+Step 6: Add the code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
public IActionResult PerformOCR()
{
- //Initialize the OCR processor.
+ // Initialize the OCR processor
OCRProcessor processor = new OCRProcessor();
- //Load a PDF document.
+ // Load a PDF document
PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf");
- //Set OCR language to process.
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Perform OCR with input document.
+ // Set Tesseract version (5.0 is bundled with v21.1.x+)
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Perform OCR on the document
string ocr = processor.PerformOCR(lDoc);
- //Save the document.
+ // Save the processed document
MemoryStream stream = new MemoryStream();
lDoc.Save(stream);
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "OCR_Azure.pdf");
@@ -83,65 +120,65 @@ public IActionResult PerformOCR()
{% endhighlight %}
{% endtabs %}
-Step 7: Now, check the OCR creation in the local machine.
+Step 7: Test the OCR creation on your local machine.
-### Steps to publish as Azure App Service
+### Steps to publish to Azure App Service
-Step 1: Right-click the project and click Publish.
-
+Step 1: Right-click the project and click **Publish**:
+
-Step 2: Create a new profile in the publish target window.
-
+Step 2: Create a new profile in the publish target window:
+
-Step 3: Select the Specific target as **Azure App Service (Windows)**.
-
+Step 3: Select the specific target as **Azure App Service (Windows)**:
+
-Step 4: To create a new app service, click **Create new** option.
+Step 4: To create a new App Service, click **Create new**:

-Step 5: Click the **Create** button to proceed with **App Service** creation.
+Step 5: Click the **Create** button to proceed with **App Service** creation:

-Step 6: Click the **Finish** button to finalize the **App Service** creation.
+Step 6: Click the **Finish** button to finalize the **App Service** creation:

-Step 7: Click **Close** button.
+Step 7: Click the **Close** button:

-Step 8: Click the **Publish** button.
+Step 8: Click the **Publish** button:

-Step 9: Now, Publish has been succeeded.
+Step 9: The publish operation has been completed successfully:

-Now, the published webpage will open in the browser, then click the **Perform OCR** button then perform OCR on a PDF document.
-
-
+The published webpage will open in the browser. Click the **Perform OCR** button to perform OCR on a PDF document:
+
+
-A complete work sample for performing OCR on a PDF document in Azure App Service on Windows can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20App%20Services).
+A complete working sample for performing OCR on a PDF document in Azure App Service on Windows can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20App%20Services).
## Azure Functions
-### Steps to perform OCR on the entire PDF document in Azure Functions
+### Steps to perform OCR on an entire PDF document in Azure Functions
-Step 1: Create the Azure function project.
-
+Step 1: Create the Azure Function project:
+
-Step 2: Select the framework to Azure Functions and select HTTP triggers as follows.
-
-
+Step 2: Select Azure Functions as the framework and configure HTTP trigger:
+
+
-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your Azure Functions project from [nuget.org](https://www.nuget.org/):

-Step 4: Copy the tessdata folder from the **bin->Debug->net6.0->runtimes** and paste it into the folder that contains the project file.
-
-
+Step 4: Copy the **tessdata** folder from **bin > Debug > net6.0 > runtimes** and paste it into the folder containing your project file:
+
+
-Step 5: Then, set Copy to output directory to give copy always the tessdata folder.
+Step 5: Set the **tessdata** folder to **Copy Always** in the output directory:

-Step 6: Include the following namespaces in the **Function1.cs** file to perform OCR for a PDF document using C#.
+Step 6: Include the following namespaces in **Function1.cs** to perform OCR on a PDF document:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -163,7 +200,7 @@ using Microsoft.Azure.WebJobs.Extensions.Http;
{% endhighlight %}
{% endtabs %}
-Step 7: Add the following code sample in the Function1 class to perform OCR for a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in Azure Functions.
+Step 7: Add the following code sample in the **Function1** class to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -174,31 +211,34 @@ public static async Task Run([HttpTrigger(AuthorizationLeve
MemoryStream ms = new MemoryStream();
try
{
+ // Initialize the OCR processor
OCRProcessor processor = new OCRProcessor();
FileStream stream = new FileStream(Path.Combine(executionContext.FunctionAppDirectory, "Data", "Input.pdf"), FileMode.Open);
- //Load a PDF document.
+ // Load a PDF document
PdfLoadedDocument lDoc = new PdfLoadedDocument(stream);
- //Set OCR language to process.
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Perform OCR with input document.
- string ocr = processor.PerformOCR(lDoc,Path.Combine(executionContext.FunctionAppDirectory, "tessdata"));
- //Save the PDF document.
+ // Set Tesseract version (5.0 is bundled with v21.1.x+)
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Perform OCR on the document with tessdata path
+ string ocr = processor.PerformOCR(lDoc, Path.Combine(executionContext.FunctionAppDirectory, "tessdata"));
+ // Save the processed PDF document
lDoc.Save(ms);
ms.Position = 0;
}
catch (Exception ex)
{
- //Add a page to the document.
+ // Create an error document with exception details
PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
- //Create PDF graphics for the page.
+ // Create PDF graphics for the page
PdfGraphics graphics = page.Graphics;
- //Set the standard font.
+ // Set the standard font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 6);
- //Draw the text.
+ // Draw the error message
graphics.DrawString(ex.ToString(), font, PdfBrushes.Black, new Syncfusion.Drawing.PointF(0, 0));
ms = new MemoryStream();
- //Save the PDF document.
+ // Save the error document
document.Save(ms);
}
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
@@ -214,40 +254,39 @@ public static async Task Run([HttpTrigger(AuthorizationLeve
{% endhighlight %}
{% endtabs %}
-Step 8: Now, check the OCR creation in the local machine.
+Step 8: Test the OCR creation on your local machine.
-### Steps to publish as Azure Functions
+### Steps to publish to Azure Functions
-Step 1: Right-click the project and click Publish. Then, create a new profile in the Publish Window. So, create the Azure Function App with a consumption plan.
+Step 1: Right-click the project and click **Publish**. Create a new profile in the Publish window to create the Azure Function App with a consumption plan:



-Step 2: To create a new app service, click **Create new** option.
+Step 2: To create a new Function App, click **Create new**:

-Step 3: Click the **Create** button to proceed with **App Service** creation.
+Step 3: Click the **Create** button to proceed with **Function App** creation:

-Step 4: Click the **Finish** button to finalize the **App Service** creation.
+Step 4: Click the **Finish** button to finalize the **Function App** creation:

-Step 5: Click deployment type.
+Step 5: Select the deployment type:

-Step 6: Click **Close** button.
+Step 6: Click the **Close** button:

-Step 7: Click the **Publish** button.
+Step 7: Click the **Publish** button:

-Step 8: Now, Publish has been succeeded.
+Step 8: The publish operation has been completed successfully:

-
-Step 9: Now, go to the Azure portal and select the Functions Apps. After running the service, click Get function URL > Copy. Include the URL as a query string in the URL. Then, paste it into the new browser tab. You will get a PDF document as follows.
+Step 9: Go to the Azure portal and select **Function Apps**. After the service is running, click **Get function URL > Copy**. Include the URL as a query string and paste it into a new browser tab. You will obtain a PDF document as follows:

A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20Function).
-Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
+Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features.
\ No newline at end of file
diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md b/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md
index 1d475319f8..6cf28ca849 100644
--- a/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md
+++ b/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md
@@ -9,63 +9,93 @@ keywords: Assemblies
# Perform OCR in Blazor
-The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Blazor application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
+The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Blazor applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine.
-## Steps to perform OCR on the entire PDF document in the Blazor application
+## Prerequisites
-{% tabcontents %}
+**Version Compatibility**
-{% tabcontent Visual Studio %}
+- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions.
+
+**Supported Inputs**
+
+The OCR processor supports the following input formats:
+
+- Single-page and multi-page PDF documents
+- Scanned images in common formats (JPEG, PNG, TIFF)
+- Recommended DPI: 200 DPI or higher for optimal OCR accuracy
+
+**Required Software**
+
+- .NET 8 SDK or later
+- Visual Studio, Visual Studio Code, or JetBrains Rider
+
+**Register the License Key**
-**Prerequisites**:
+N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation.
-* 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).
-* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735).
+Include the following code in the **Program.cs** file to register the license key:
+
+{% tabs %}
+{% highlight c# tabtitle="C#" %}
+using Syncfusion.Licensing;
+
+// Register Syncfusion license at application startup
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+{% endhighlight %}
+{% endtabs %}
-Step 1: Create a new C# Blazor Server application project. Select Blazor App from the template and click Next.
+N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly.
+N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages.
+
+## Steps to perform OCR on an entire PDF document in Blazor
+
+{% tabcontents %}
+
+{% tabcontent Visual Studio %}
+
+Step 1: Create a new C# Blazor Server application project targeting **.NET 6 or later**. Select **Blazor App** from the template and click **Next**:

-Step 2: In the project configuration window, name your project and click Create.
+Step 2: In the project configuration window, name your project and click **Create**.

-Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your Blazor application from [NuGet.org](https://www.nuget.org/).

-N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths.
-N> 2. Starting with v16.2.0.x, if you reference Syncfusion® 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 Syncfusion® license key in your application to use our components.
-
-Step 4: Create a new class file named *ExportService* under the Data folder and include the following namespaces in the file.
+Step 4: Create a new class file named **ExportService** under the Data folder and include the following namespaces:
{% tabs %}
{% highlight c# tabtitle="C#" %}
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
-using System.IO;
{% endhighlight %}
{% endtabs %}
-Step 5: Use the following code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in the **ExportService** file.
+Step 5: Use the following code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in the **ExportService** file:
{% tabs %}
{% highlight c# tabtitle="C#" %}
public MemoryStream CreatePdf()
{
- //Initialize the OCR processor.
+ // Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor("Tesseractbinaries/Windows"))
{
FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
- //Load a PDF document.
+ // Load a PDF document
PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream);
- //Set OCR language to process.
+ // Set OCR language
processor.Settings.Language = Languages.English;
- //Process OCR by providing the PDF document.
+ // Set Tesseract version
+ processor.Settings.TesseractVersion = TesseractVersion.Version5_0;
+ // Perform OCR on the document
processor.PerformOCR(lDoc, "tessdata/");
- //Create memory stream.
+ // Create memory stream and save the processed document
MemoryStream stream = new MemoryStream();
- //Save the document to memory stream.
lDoc.Save(stream);
return stream;
}
@@ -74,7 +104,7 @@ public MemoryStream CreatePdf()
{% endhighlight %}
{% endtabs %}
-Step 6: Register your service in the ConfigureServices method available in the *Startup.cs* class as follows.
+Step 6: Register your service in the **ConfigureServices** method available in **Startup.cs**:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -90,19 +120,19 @@ public void ConfigureServices(IServiceCollection services)
{% endhighlight %}
{% endtabs %}
-Step 7: Inject ExportService into *FetchData.razor* using the following code.
+Step 7: Inject **ExportService** into **FetchData.razor** using the following code:
{% tabs %}
{% highlight CSHTML %}
@inject ExportService exportService
@inject Microsoft.JSInterop.IJSRuntime JS
-@using System.IO
+@using System.IO
{% endhighlight %}
{% endtabs %}
-Step 8: Create a button in the *FetchData.razor* using the following code.
+Step 8: Create a button in **FetchData.razor** using the following code:
{% tabs %}
{% highlight CSHTML %}
@@ -112,7 +142,7 @@ Step 8: Create a button in the *FetchData.razor* using the following code.
{% endhighlight %}
{% endtabs %}
-Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export service.
+Step 9: Add the **PerformOCR** method in **FetchData.razor** to call the export service:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -122,9 +152,9 @@ Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export s
protected async Task PerformOCR()
{
ExportService exportService = new ExportService();
- using (MemoryStream excelStream = exportService.CreatePdf())
+ using (MemoryStream pdfStream = exportService.CreatePdf())
{
- await JS.SaveAs("Output.pdf", excelStream.ToArray());
+ await JS.SaveAs("Output.pdf", pdfStream.ToArray());
}
}
}
@@ -132,7 +162,7 @@ Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export s
{% endhighlight %}
{% endtabs %}
-Step 10: Create a class file with the FileUtil name and add the following code to invoke the JavaScript action to download the file in the browser.
+Step 10: Create a class file named **FileUtil** and add the following code to invoke the JavaScript action to download the file in the browser:
{% tabs %}
{% highlight c# tabtitle="C#" %}
@@ -149,7 +179,7 @@ public static class FileUtil
{% endhighlight %}
{% endtabs %}
-Step 11: Add the following JavaScript function in the *_Host.cshtml* available under the Pages folder.
+Step 11: Add the following JavaScript function in **_Host.cshtml** (available under the Pages folder):
{% tabs %}
{% highlight CSHTML %}
@@ -157,7 +187,7 @@ Step 11: Add the following JavaScript function in the *_Host.cshtml* available u
+
+
in the **~/Components/App.razor** file as shown below.
+Register the Syncfusion license key in your application startup to avoid a license warning at runtime. Add the following line in the **Program.cs** file of your Blazor Web App (and in the client project's **Program.cs** for `WebAssembly`/`Auto` render modes), after the `AddSyncfusionBlazor()` call:
{% tabs %}
-{% highlight razor tabtitle="App.razor" %}
+{% highlight c# tabtitle="Program.cs" %}
-
- ....
-
-
-
- ....
-
-
+// Register Syncfusion license key
+Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
{% endhighlight %}
{% endtabs %}
-N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application.
+N> Replace `YOUR_LICENSE_KEY` with your actual Syncfusion license key. For details on generating and registering a license key, see [Licensing](https://blazor.syncfusion.com/documentation/licensing).
-## Add Blazor Spreadsheet component
+## Add stylesheet resource
-Add the Syncfusion Blazor Spreadsheet component in the **~/Components/Pages/*.razor** file. If the interactivity location is set to `Per page/component` in the Web App, define a render mode at the top of the `~/Pages/*.razor` file. (For example, `InteractiveServer`, `InteractiveWebAssembly` or `InteractiveAuto`).
+The theme stylesheet can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet at the end of the `` section in the **Components/App.razor** file to apply proper layout and theme styling.
+
+{% tabs %}
+{% highlight razor tabtitle="App.razor" %}
-N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssembly`, the render mode is automatically configured in the `App.razor` file by default.
+
+
+
+{% endhighlight %}
+{% endtabs %}
+
+## Add script resource
+
+The Spreadsheet Editor script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the required script at the end of the `` section in the **Components/App.razor** file to enable component functionality.
{% tabs %}
-{% highlight razor %}
+{% highlight razor tabtitle="App.razor" %}
-@* desired render mode define here *@
-@rendermode InteractiveServer
+
+
{% endhighlight %}
{% endtabs %}
+N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application.
+
+## Add Blazor Spreadsheet component
+
+Add the Syncfusion Blazor Spreadsheet component in the **Components/Pages/Home.razor** file (the default page template). If the interactivity location is set to `Per page/component` in the Web App, define a render mode at the top of the `Components/Pages/Home.razor` file. (For example, `InteractiveServer`, `InteractiveWebAssembly` or `InteractiveAuto`).
+
+N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssembly`, the render mode is automatically configured in the `App.razor` file by default and does not need to be specified on the page.
+
{% tabs %}
{% highlight razor tabtitle="Home.razor" %}
@@ -231,6 +254,8 @@ N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssem
{% endhighlight %}
{% endtabs %}
+N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI.
+
Press Ctrl+F5 (Windows) or ⌘+F5 (macOS) to launch the application. This will render the Syncfusion Blazor Spreadsheet in your default web browser. The output will appear as follows:

@@ -254,4 +279,4 @@ To get started quickly with Blazor Spreadsheet, you can watch this video:
## See Also
- [Getting started with the Blazor Spreadsheet in a Blazor WebAssembly App](./getting-started)
-- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app)
+- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md
index e517532aa2..c6cf40d28b 100644
--- a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md
+++ b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md
@@ -1,7 +1,7 @@
---
layout: post
-title: Getting Started with Blazor Spreadsheet Component in WASM| Syncfusion
-description: Checkout and learn about getting started with Blazor Spreadsheet component in Blazor WebAssembly Application.
+title: Getting Started with Blazor Spreadsheet Component in WASM | Syncfusion
+description: Check out and learn about getting started with Blazor Spreadsheet component in Blazor WebAssembly Application.
platform: document-processing
control: Spreadsheet
documentation: ug
@@ -70,7 +70,7 @@ cd BlazorApp
* Press Ctrl+` to open the integrated terminal in Visual Studio Code.
* Ensure you’re in the project root directory where your `.csproj` file is located.
-* Run the following command to install a [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed.
+* Run the following command to install the [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages and ensure all dependencies are installed.
{% tabs %}
@@ -84,13 +84,15 @@ dotnet restore
{% endtabs %}
+N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry.
+
{% endtabcontent %}
{% tabcontent .NET CLI %}
## Prerequisites
-Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If the .NET SDK is already installed, determine the installed version by running the following command in a command prompt (Windows), terminal (macOS), or command shell (Linux).
+Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If the .NET SDK is already installed, determine the installed version by running the following command in a command prompt (Windows), terminal (macOS), or command shell (Linux). Also, review the [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements).
{% tabs %}
{% highlight c# tabtitle=".NET CLI" %}
@@ -119,7 +121,7 @@ After creating the Blazor WebAssembly App, install the required Syncfusion NuGet
* Open a command prompt, terminal, or shell.
* Ensure you’re in the project root directory where your `.csproj` file is located.
-* Run the following command to install a [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed.
+* Run the following command to install the [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages and ensure all dependencies are installed.
{% tabs %}
@@ -133,13 +135,15 @@ dotnet restore
{% endtabs %}
+N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry.
+
{% endtabcontent %}
{% endtabcontents %}
## Add import namespaces
-After the packages are installed, open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces.
+After the packages are installed, open the **_Imports.razor** file (typically located at the project root in a Blazor WebAssembly App) and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces.
{% tabs %}
{% highlight razor tabtitle="_Imports.razor" %}
@@ -152,32 +156,64 @@ After the packages are installed, open the **~/_Imports.razor** file and import
## Register Blazor Service
-Register the Syncfusion Blazor service in the **~/Program.cs** file of your Blazor WebAssembly App.
+Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor WebAssembly App. Place the registration after the host builder is created and before `await builder.Build().RunAsync();`.
{% tabs %}
{% highlight C# tabtitle="Program.cs" %}
-....
using Syncfusion.Blazor;
-....
+var builder = WebAssemblyHostBuilder.CreateDefault(args);
+
+// Register Syncfusion Blazor service
builder.Services.AddSyncfusionBlazor();
-....
+await builder.Build().RunAsync();
+
+{% endhighlight %}
+{% endtabs %}
+
+N> `AddSyncfusionBlazor()` accepts optional configuration options such as enabling script isolation. See the [Blazor service registration](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.GlobalOptions.html) topic for available configuration options.
+
+## Register Syncfusion License Key
+
+Register the Syncfusion license key in your application startup to avoid a license warning at runtime. Add the following line in the **Program.cs** file of your Blazor WebAssembly App, after the `AddSyncfusionBlazor()` call:
+
+{% tabs %}
+{% highlight c# tabtitle="Program.cs" %}
+
+// Register Syncfusion license key
+Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
{% endhighlight %}
{% endtabs %}
-## Add stylesheet and script resources
+N> Replace `YOUR_LICENSE_KEY` with your actual Syncfusion license key. For details on generating and registering a license key, see [Licensing](https://blazor.syncfusion.com/documentation/licensing).
+
+## Add stylesheet resource
-The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet and script references in the `` section of the **~/index.html** file.
+The theme stylesheet can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the `` section of the **index.html** file.
{% tabs %}
{% highlight html tabtitle="index.html" %}
- ....
+
+
+
+{% endhighlight %}
+{% endtabs %}
+
+## Add script resource
+
+The Spreadsheet Editor script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the script reference in the `` section of the **index.html** file.
+
+{% tabs %}
+{% highlight html tabtitle="index.html" %}
+
+
+
@@ -186,9 +222,9 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A
N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application.
-## Add Blazor Spreadsheet component
+## Add the Blazor Spreadsheet component
-Add the Blazor Spreadsheet component in the **~/Pages/Home.razor** file.
+Add the Blazor Spreadsheet component in the **Pages/Home.razor** file.
{% tabs %}
{% highlight razor tabtitle="Home.razor" %}
@@ -203,6 +239,8 @@ Add the Blazor Spreadsheet component in the **~/Pages/Home.razor** file.
{% endhighlight %}
{% endtabs %}
+N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI.
+
Press Ctrl+F5 (Windows) or ⌘+F5 (macOS) to launch the application. This will render the Syncfusion Blazor Spreadsheet in your default web browser. The output will appear as follows:

@@ -217,9 +255,7 @@ N> [View Sample In GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting
N> Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page
-
## See Also
-- [Getting started with the Blazor Spreadsheet in a Blazor Web app Server app](./getting-started-webapp)
-- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app)
-
+- [Getting started with the Blazor Spreadsheet in a Blazor Web App (Server)](./getting-started-webapp)
+- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md b/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md
index 28fb11ac77..607733574a 100644
--- a/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md
+++ b/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md
@@ -11,6 +11,11 @@ documentation: ug
The **Open** and **Save** functionalities in the Blazor Spreadsheet component allow for efficient management of Excel files. You can open existing Excel files for analysis and modification, and save new or modified spreadsheets in a compatible format.
+## New
+To create a new, blank workbook through the UI, select **File > New** from the **Ribbon**. This action initializes a blank spreadsheet component, ready for data entry or formatting. If unsaved changes are present, a confirmation dialog will appear, indicating that these changes will be lost. The dialog presents options to proceed with creating the new workbook by selecting **OK**, or to cancel the operation by selecting **Cancel**.
+
+
+
## Open
The [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) component preserves all data, cell styles, formatting, and other spreadsheet elements when opening Excel files. These files can be loaded through the user interface action or programmatic methods.
@@ -78,6 +83,8 @@ An Excel file encoded as a Base64 string can be loaded into the Spreadsheet comp
The Blazor Spreadsheet component accepts data only as a byte array through the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_DataSource) property. To load JSON data into the Spreadsheet, convert the JSON data into an Excel file format using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview), then convert it to a byte array. This approach allows importing JSON data from a local file or a remote URL.
+N> To run the following examples, install the [Syncfusion.XlsIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.core) NuGet package in your project to access the XlsIO APIs used for converting JSON data to Excel format.
+
#### Load an Excel file from a local JSON file
JSON data can be loaded from a local JSON file, converted to Excel format using XlsIO, and displayed in the Spreadsheet component. This approach is useful when working with static JSON data files within the application. The implementation reads the JSON file, converts it to Excel format using XlsIO, and binds it to the Spreadsheet as a byte array.
@@ -231,6 +238,8 @@ JSON data can be loaded from a local JSON file, converted to Excel format using
Remote JSON data can be integrated into the Spreadsheet component by converting it into an Excel-compatible format. The process begins with asynchronous retrieval of JSON from the specified endpoint using HttpClient. The fetched data is then transformed into an Excel workbook through XlsIO, and the resulting byte array is passed to the Spreadsheet for rendering. This approach is particularly useful for integrating real-time data from REST APIs or other web services.
+N> Before using HttpClient, register it in the **Program.cs** file of your application. For Blazor WebAssembly, add `builder.Services.AddHttpClient();` before `await builder.Build().RunAsync();`. For Blazor Server, add `builder.Services.AddHttpClient();` in the service configuration section.
+
{% tabs %}
{% highlight razor tabtitle="Index.razor" %}
@@ -504,7 +513,7 @@ The Spreadsheet component supports opening the following file formats:
The Spreadsheet component allows you to save data, styles, formatting, and other content as an Excel file. This functionality ensures that all modifications are preserved in a compatible format.
### Save an Excel file using UI
-To save the Spreadsheet content through the user interface, select the **File > Save As** option from the **Ribbon**.You can then specify the file name and format in the save dialog.
+To save the Spreadsheet content through the user interface, select the **File > Save As** option from the **Ribbon**. You can then specify the file name and format in the save dialog.

@@ -572,6 +581,8 @@ N> If options are not provided, the default settings are **FileName**: `"Spreads
The [SaveAsStreamAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SaveAsStreamAsync) method retrieves the spreadsheet content as a [MemoryStream](https://learn.microsoft.com/dotnet/api/system.io.memorystream) for further processing, such as saving to a database or cloud storage.
+N> The following example uses `File.Create` to persist the stream to disk, which works only in Blazor Server (where the server has file system access). In Blazor WebAssembly, browser security prevents direct file system writes; use JavaScript interop (`IJSRuntime`) to trigger a client-side download, or send the stream to a backend API for storage.
+
{% tabs %}
{% highlight razor tabtitle="Index.razor" %}
@@ -608,7 +619,7 @@ The Blazor Spreadsheet component supports exporting spreadsheet data to multiple
**Supported Save Formats:**
| SaveType | File Extension | Description |
-|---|---|---|---|
+|---|---|---|
| `Xlsx` | `.xlsx` | Microsoft Excel 2007 and later format |
| `Xls` | `.xls` | Microsoft Excel 97-2003 format |
| `Csv` | `.csv` | Comma Separated Values format |
@@ -677,6 +688,15 @@ PDF export from the Blazor Spreadsheet component supports customization of layou
| `Orientation` | `PdfPageOrientation` | `Portrait` | Controls page orientation: `Portrait` (8.5" × 11") or `Landscape` (11" × 8.5"). Choose Portrait for standard letter-sized documents or Landscape for wide data ranges. |
| `FitSheetOnOnePage` | `bool` | `false` | Determines content scaling behavior: `true` scales content proportionally to fit entire sheet on single page; `false` allows content to span multiple pages using normal printing pagination. |
+**Configuring PDF Layout Settings via BeforeSave Event:**
+
+The [BeforeSaveEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.BeforeSaveEventArgs.html) class provides properties that can be used to customize the PDF layout settings during the save operation.
+
+| Property | Type | Description |
+|---|---|---|
+| `SaveType` | Enum | Gets the export format specified in the [SaveOptions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SaveOptions.html) during the save operation. Use this to apply conditional logic (for example, only configure PDF layout when `SaveType.Pdf` is detected). |
+| `PdfLayoutSettings` | Class | Gets or sets the PDF layout configuration (page orientation and scaling behavior). Assign a `PdfLayoutSettings` instance to apply custom layout before the PDF is generated. |
+
**Layout Configuration Guide:**
**Orientation Selection:**
@@ -732,7 +752,13 @@ The following code example demonstrates saving the spreadsheet as PDF with diffe
### Preserve fonts when saving PDF (Blazor WebAssembly)
-In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFont` property of the SfSpreadsheet component. Provide local TrueType font (.ttf) files from wwwroot and reference them via the component.
+In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFonts` property of the SfSpreadsheet component. Provide local TrueType font (.ttf) files from wwwroot and reference them via the component.
+
+**CustomFonts Parameter:**
+
+| Property | Type | Description |
+|---|---|---|
+| `CustomFonts` | `List` | Gets or sets the list of local TrueType font (.ttf) file paths (relative to `wwwroot`) that the WASM PDF exporter fetches and embeds in the generated PDF. Only local `.ttf` files are supported; remote URLs are not allowed.|
#### How to use
- Place .ttf files under wwwroot (for example: wwwroot/Arial.ttf).
@@ -763,9 +789,4 @@ In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFont` pr
{% endhighlight %}
{% endtabs %}
-N> Only local TrueType (.ttf) files referenced in `CustomFonts` are fetched and embedded by the WASM PDF exporter. If a font used in the sheet is not provided, a fallback font will be used and the appearance may change.
-
-## New
-To create a new, blank workbook through the UI, select **File > New** from the **Ribbon**. This action initializes a blank spreadsheet component, ready for data entry or formatting. If unsaved changes are present, a confirmation dialog will appear, indicating that these changes will be lost. The dialog presents options to proceed with creating the new workbook by selecting **OK**, or to cancel the operation by selecting **Cancel**.
-
-
+N> Only local TrueType (.ttf) files referenced in `CustomFonts` are fetched and embedded by the WASM PDF exporter. If a font used in the sheet is not provided, a default font will be used and the appearance may change.
diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md
index ce8ee0563b..c84801efc5 100644
--- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md
+++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md
@@ -1,22 +1,24 @@
---
layout: post
title: React Spreadsheet getting started with Create React App | Syncfusion
-description: Checkout and learn how to use the React Spreadsheet component of Syncfusion Essential JS 2 in a Create React App project.
+description: Check out and learn how to use the React Spreadsheet component of Syncfusion Essential JS 2 in a Create React App project.
control: Spreadsheet
platform: document-processing
documentation: ug
---
-# Getting Started with React Spreadsheet Editor using Create React App
+# Getting Started with the React Spreadsheet Editor in Create React App
This article provides a step-by-step guide for setting up a React application using Create React App and integrating React Spreadsheet Editor.
+> **Note:** Create React App (CRA) is no longer actively maintained, and the React team recommends modern build tools such as [Vite](https://vitejs.dev/) or [Next.js](https://nextjs.org/) for new projects. This guide remains available for existing CRA-based projects. To start a new project with Next.js, see [Getting Started with the React Spreadsheet Component in a Next.js Project](./nextjs-getting-started.md).
+
## Prerequisites
Ensure the following requirements are met before starting:
[System requirements for React Spreadsheet Editor](https://ej2.syncfusion.com/react/documentation/system-requirement)
-## Create the React application
+## Create the React Application
The recommended approach is to use the [`Create React App`](https://github.com/facebook/create-react-app) tool for initializing your project. This tool sets up a development environment and optimizes the build for production.
@@ -41,7 +43,7 @@ npx create-react-app my-app --template typescript
cd my-app
```
-Besides using the `npx` package runner tool, also create an application from the `npm init`. To begin with the `npm init`, upgrade the `npm` version to `npm 6`+.
+You can also initialize a project with `npm init react-app` instead of `npx`. This requires `npm 6` or later (npm 10+ is recommended, bundled with current Node.js LTS).
```bash
npm init react-app my-app
@@ -63,9 +65,9 @@ or
yarn add @syncfusion/ej2-react-spreadsheet
```
-## Import CSS
+## Add CSS references
-The React Spreadsheet Editor come with built-in [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme). Import the CSS styles for the Spreadsheet component and its dependent components in the `src/App.css` file. The example below demonstrates importing the `Tailwind 3` theme.
+Add the following Spreadsheet and dependent component style references to the `src/App.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme.
```css
@import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css';
@@ -80,11 +82,13 @@ The React Spreadsheet Editor come with built-in [themes](https://ej2.syncfusion.
@import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css';
```
-For more details on built-in themes and usage, refer to the [Themes topic](https://ej2.syncfusion.com/react/documentation/appearance/theme).
+Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements.
+
+> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section.
-## Adding Spreadsheet component
+## Add the Syncfusion® React Spreadsheet Component
-Now, you can import the spreadsheet component into your `src/App.js` file.
+Now, import the `SpreadsheetComponent` into `src/App.js` file and replace the existing code with the following:
{% tabs %}
{% highlight js tabtitle="app.jsx" %}
@@ -92,7 +96,7 @@ import * as React from 'react';
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
import './App.css';
export default function App() {
- return ();
+ return ();
}
{% endhighlight %}
{% highlight ts tabtitle="app.tsx" %}
@@ -100,13 +104,13 @@ import * as React from 'react';
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
import './App.css';
export default function App() {
- return ();
+ return ();
}
{% endhighlight %}
{% endtabs %}
-## Run the application
-Run the app using the following commands:
+## Run the Application
+Run the app using the following command:
```bash
npm start
@@ -117,7 +121,12 @@ or
```bash
yarn start
```
+
N> Looking for the full React Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) page.
## See Also
-* [Getting Started with React Spreadsheet](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/getting-started)
\ No newline at end of file
+* [Getting Started with React Spreadsheet](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/getting-started)
+* [Getting Started with the React Spreadsheet Component in a Next.js Project](./nextjs-getting-started)
+* [Open Excel files](../open-excel-files)
+* [Save Excel files](../save-excel-files)
+* [Data Binding](../data-binding)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md
index 1a517759d0..e4ec5d4a01 100644
--- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md
+++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md
@@ -1,7 +1,7 @@
---
layout: post
title: React Spreadsheet getting started with Next.js | Syncfusion
-description: Checkout and learn about how to use React Spreadsheet component of Syncfusion Essential JS 2 in the Next.js project.
+description: Check out and learn about how to use React Spreadsheet component of Syncfusion Essential JS 2 in the Next.js project.
control: Next.js
platform: document-processing
documentation: ug
@@ -12,7 +12,7 @@ This section provides a step-by-step guide for setting up a Next.js application
## What is Next.js?
-[Next.js](https://nextjs.org/) is a React framework that makes it easy to build fast, SEO-friendly, and user-friendly web applications. It provides features such as server-side rendering, automatic code splitting, routing, and API routes, making it an excellent choice for building modern web applications.
+[Next.js](https://nextjs.org) is a React framework that makes it easy to build fast, SEO-friendly, and user-friendly web applications. It provides features such as server-side rendering, automatic code splitting, routing, and API routes, making it an excellent choice for building modern web applications.
## Prerequisites
@@ -41,7 +41,7 @@ yarn create next-app
Using one of the above commands will lead you to set up additional configurations for the project as below:
-1.Define the project name: Users can specify the name of the project directly. Let's specify the name of the project as `ej2-next-js-spreadsheet`.
+1. Define the project name: Users can specify the name of the project directly. Let's specify the name of the project as `ej2-next-js-spreadsheet`.
{% tabs %}
{% highlight bash tabtitle="CMD" %}
@@ -51,7 +51,7 @@ Using one of the above commands will lead you to set up additional configuration
{% endhighlight %}
{% endtabs %}
-2.Select the required packages.
+2. Select the required packages.
{% tabs %}
{% highlight bash tabtitle="CMD" %}
@@ -68,7 +68,7 @@ Creating a new Next.js app in D:\ej2-next-js-spreadsheet.
{% endhighlight %}
{% endtabs %}
-3.Once complete the above mentioned steps to create `ej2-next-js-spreadsheet`, navigate to the directory using the below command:
+3. After completing the above steps to create `ej2-next-js-spreadsheet`, navigate to the directory using the below command:
{% tabs %}
{% highlight bash tabtitle="CMD" %}
@@ -89,7 +89,7 @@ Here, the [React Spreadsheet component](https://www.syncfusion.com/spreadsheet-e
{% tabs %}
{% highlight bash tabtitle="NPM" %}
-npm install @syncfusion/ej2-react-spreadsheet --save
+npm install @syncfusion/ej2-react-spreadsheet
{% endhighlight %}
{% highlight bash tabtitle="YARN" %}
@@ -101,27 +101,27 @@ yarn add @syncfusion/ej2-react-spreadsheet
## Import Syncfusion® CSS styles
-React components come with [built-in themes](https://ej2.syncfusion.com/react/documentation/appearance/theme), which are available in the installed packages. It’s easy to adapt the Syncfusion® React components to match the style of your application by referring to one of the built-in themes.
-
-Import the `Material` theme into the **src/app/globals.css** file and removed the existing styles in that file, as shown below:
+Add the following Spreadsheet and dependent component style references to the `src/app/globals.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme.
{% tabs %}
{% highlight css tabtitle="globals.css" %}
-@import '../../node_modules/@syncfusion/ej2-base/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-inputs/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-buttons/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-lists/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-navigations/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-popups/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-grids/styles/material.css';
-@import '../../node_modules/@syncfusion/ej2-react-spreadsheet/styles/material.css';
+@import '@syncfusion/ej2-base/styles/tailwind3.css';
+@import '@syncfusion/ej2-inputs/styles/tailwind3.css';
+@import '@syncfusion/ej2-buttons/styles/tailwind3.css';
+@import '@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
+@import '@syncfusion/ej2-lists/styles/tailwind3.css';
+@import '@syncfusion/ej2-navigations/styles/tailwind3.css';
+@import '@syncfusion/ej2-popups/styles/tailwind3.css';
+@import '@syncfusion/ej2-dropdowns/styles/tailwind3.css';
+@import '@syncfusion/ej2-grids/styles/tailwind3.css';
+@import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css';
{% endhighlight %}
{% endtabs %}
+Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements.
+
> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section.
## Add Syncfusion® React component
@@ -373,6 +373,8 @@ export let defaultData: object[] = [
2.Then, import and define the Spreadsheet component in the **src/app/page.tsx** file, as shown below:
+> The Syncfusion® Spreadsheet component relies on browser APIs (DOM, events) and does not support server-side rendering. Add the `'use client'` directive at the top of `page.tsx` to mark the file as a Client Component so the Spreadsheet renders only on the client side and avoids Next.js hydration errors.
+
{% tabs %}
{% highlight ts tabtitle="page.tsx" %}
@@ -380,7 +382,7 @@ export let defaultData: object[] = [
import { SpreadsheetComponent, SheetsDirective, SheetDirective, ColumnsDirective, RangesDirective, RangeDirective, RowsDirective, RowDirective, CellsDirective, CellDirective, CellStyleModel, ColumnDirective } from '@syncfusion/ej2-react-spreadsheet';
import { defaultData } from './datasource';
-export default function Home(this: any) {
+export default function Home() {
let spreadsheet!: SpreadsheetComponent;
const boldRight: CellStyleModel = { fontWeight: 'bold', textAlign: 'right' };
const bold: CellStyleModel = { fontWeight: 'bold' };
@@ -395,7 +397,7 @@ export default function Home(this: any) {
React Spreadsheet Editor
{ spreadsheet = Obj as SpreadsheetComponent }} created={onCreated.bind(this)} >
+ ref={(Obj) => { spreadsheet = Obj as SpreadsheetComponent }} created={onCreated} >
@@ -427,6 +429,8 @@ export default function Home(this: any) {
{% endhighlight %}
{% endtabs %}
+> **Note:** The [`openUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#openurl) and [`saveUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#saveurl) endpoints used in this example are provided only for demonstration purposes. For development and production use, we strongly recommend configuring your own local or hosted web service for the Open and Save actions instead of relying on the online demo service. For more information, refer to the [`Web Services`](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/web-services/webservice-overview) section.
+
## Run the application
To run the application, use the following command:
@@ -446,4 +450,17 @@ yarn run dev
To learn more about the functionality of the Spreadsheet component, refer to the [documentation](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/feature-list).
+## Troubleshooting
+
+Common setup and runtime issues are listed below with their cause and a resolution.
+
+| Issue | Likely cause | Resolution |
+|---|---|---|
+| **`use client` / hydration error**: `Text content did not match` or error referencing server-rendered HTML. | The Spreadsheet uses browser APIs (DOM, events) and cannot be server-rendered. | Ensure the `'use client'` directive is present at the top of `src/app/page.tsx`. If the component is imported into a Server Component, move it to a separate Client Component file. See [React Server and Client Components](https://react.dev/reference/rsc/use-client). |
+| **CSS not applied / unstyled component** (plain HTML layout, broken toolbar icons). | Theme stylesheets were not imported or imported with the wrong relative path. | Verify the `@import` blocks for all dependency CSS files (`ej2-base`, `ej2-inputs`, etc.) are present in `src/app/globals.css` and the paths resolve from the `src/app/` location. Restart the dev server after editing CSS. |
+| **`Cannot find module '@syncfusion/ej2...'` or peer dependency warnings during `npm install`.** | Package not installed, or React version mismatch. | Re-run `npm install @syncfusion/ej2-react-spreadsheet`. For peer dependency conflicts, ensure React is on a version supported by the package (see the [NuGet package / npm version](../../../../NuGet-Packages.md) notes) and use `--legacy-peer-deps` only as a temporary workaround. |
+| **License warning or toolbar shows a license banner at runtime.** | Syncfusion license key not registered, or registered after the component renders. | Register the license key in the application entry point **before** rendering any Syncfusion component. See [Register the Syncfusion License Key](../../register-the-syncfusion-license-key) and [Licensing FAQ](../../../../Licensing/licensing-faq). |
+| **Open/Save actions fail with network or CORS errors.** | The `openUrl` / `saveUrl` endpoints are unreachable from the browser, or in production the Syncfusion demo services are rate-limited / blocked. | Host your own Spreadsheet open/save web service and ensure CORS is enabled. Refer to the [Web Services](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/web-services/webservice-overview) section. |
+
+
N> Looking for the full React Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) page.
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md
index 41692600f5..969b8f73af 100644
--- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md
+++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md
@@ -1,13 +1,13 @@
---
layout: post
-title: Getting started with React Spreadsheet component | Syncfusion
-description: Checkout and learn about Getting started with React Spreadsheet component of Syncfusion Essential JS 2 and more details.
+title: Getting Started with React Spreadsheet component | Syncfusion
+description: Check out and learn about getting started with the React Spreadsheet component of Syncfusion Essential JS 2 and more details.
control: Getting started
platform: document-processing
documentation: ug
---
-# Getting Started with React Spreadsheet component
+# Getting Started with React Spreadsheet Component
This section explains how to create a simple React application and add the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) component with the minimum required setup.
@@ -41,29 +41,33 @@ cd spreadsheet-app
Install the [Syncfusion® React Spreadsheet](https://www.npmjs.com/package/@syncfusion/ej2-react-spreadsheet) package from npm using the following command:
```
-npm install @syncfusion/ej2-react-spreadsheet --save
+npm install @syncfusion/ej2-react-spreadsheet
```
## Add CSS references
-Add the following Spreadsheet and dependent component style references to the `src/index.css` file.
+Add the following Spreadsheet and dependent component styles to `src/index.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme.
```css
-@import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-dropdowns/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-grids/styles/tailwind3.css';
-@import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css';
+@import '@syncfusion/ej2-base/styles/tailwind3.css';
+@import '@syncfusion/ej2-inputs/styles/tailwind3.css';
+@import '@syncfusion/ej2-buttons/styles/tailwind3.css';
+@import '@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
+@import '@syncfusion/ej2-lists/styles/tailwind3.css';
+@import '@syncfusion/ej2-navigations/styles/tailwind3.css';
+@import '@syncfusion/ej2-popups/styles/tailwind3.css';
+@import '@syncfusion/ej2-dropdowns/styles/tailwind3.css';
+@import '@syncfusion/ej2-grids/styles/tailwind3.css';
+@import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css';
```
-## Add the Syncfusion® React Spreadsheet component to the application
+Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements.
-Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it.
+> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section.
+
+## Add the Syncfusion® React Spreadsheet component
+
+Import and render the `SpreadsheetComponent` in `src/App.jsx` or `src/App.tsx`. Replace the existing content with the following code.
{% tabs %}
{% highlight js tabtitle="app.jsx" %}
@@ -104,7 +108,7 @@ npm run dev
After the application starts, open the localhost URL shown in the terminal to view the React Spreadsheet Editor in the browser. The output will appear as follows:
-
+
You can also explore the Spreadsheet interactively using the live sample below.
@@ -122,7 +126,7 @@ N> Looking for the full React Spreadsheet Editor component overview, features, p
## See also
-* [Data Binding](./data-binding)
* [Open Excel files](./open-excel-files)
* [Save Excel files](./save-excel-files)
* [Web Services](./web-services/webservice-overview)
+* [Data Binding](./data-binding)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/UWP/Getting-Started.md b/Document-Processing/Excel/Spreadsheet/UWP/Getting-Started.md
index 3dd334d120..f75d1d86d8 100644
--- a/Document-Processing/Excel/Spreadsheet/UWP/Getting-Started.md
+++ b/Document-Processing/Excel/Spreadsheet/UWP/Getting-Started.md
@@ -16,7 +16,12 @@ This section briefly explains how to include the [Syncfusion® UWP Sp
## Create a new UWP App in Visual Studio
-You can create a **UWP Application** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-uwp?view=visualstudio&tabs=vs-2022-17-10) or the [Syncfusion® UWP](https://help.syncfusion.com/uwp/visual-studio-integration/create-project).
+1. Open **Visual Studio** and click **Create a new project**.
+2. Select **Blank App (Universal Windows)** from the project templates and click **Next**.
+3. Enter a **Project name** (for example, `SpreadsheetApp`), choose a **Location**, and click **Create**.
+4. In the **New Universal Windows Platform Project** dialog, select the required **Target version** and **Minimum version** (Windows 10, version 1903 or later is recommended) and click **OK**.
+
+For more information, see [Microsoft templates](https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-uwp?view=visualstudio&tabs=vs-2022-17.10) or [Syncfusion® UWP project creation](https://help.syncfusion.com/uwp/visual-studio-integration/create-project).
## Assemblies Deployment
@@ -28,7 +33,7 @@ You can add a UWP spreadsheet component to your application by installing it via
### Install Syncfusion® UWP Spreadsheet NuGet Package
-To add **UWP Spreadsheet** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install:
+To add the **UWP Spreadsheet** component to the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install:
• [Syncfusion.SfSpreadsheet.UWP](https://www.nuget.org/packages/Syncfusion.SfSpreadsheet.UWP)
@@ -36,9 +41,12 @@ To add **UWP Spreadsheet** component in the application, open the NuGet package
{% tabcontent Assemblies (.dll) %}
-### Add Syncfusion® UWP Spreadsheet Assemblies
+### Add Syncfusion® UWP Spreadsheet Assemblies
+
+To manually add the assemblies:
+
-Below table describes, list of assemblies required to be added in project when the UWP Spreadsheet control is used in your application.
+The table below lists the assemblies required to be added to the project when the UWP Spreadsheet control is used in your application.
@@ -48,37 +56,38 @@ Description
Syncfusion.SfCellGrid.UWP.dll
-Contains the base and fundamental classes which hold the underlying architecture for displaying cells with virtualized behavior and selection/interaction of cells.
+Contains the base classes that provide the virtualized cell-display architecture and cell selection/interaction behavior.
Syncfusion.SfGridCommon.UWP.dll
-Covers the classes which hold the properties of scroll viewer and disposable elements
+Contains the classes that expose the scroll viewer properties and disposable elements.
Syncfusion.SfSpreadsheet.UWP.dll
-Contains the classes that handle all the UI Operations of SfSpreadsheet such as importing of sheets, applying formulas/styles etc.
+Contains the classes that handle the UI operations of SfSpreadsheet, such as importing sheets and applying formulas and styles.
Syncfusion.SfShared.UWP.dll
-Contains the classes which hold the properties and operations of the controls like SfUpDown, SfNavigator, Looping control etc
+Contains the classes that hold the properties and operations of controls such as SfUpDown, SfNavigator, and the Looping control.
Syncfusion.SfInput.UWP.dll
-Contains the classes which hold the controls like SfDropDownButton, SfTextBoxExt,SfMaskedEdit etc.
+Contains the input control classes such as SfDropDownButton, SfTextBoxExt, and SfMaskedEdit.
Syncfusion.SfRibbon.UWP.dll
-Covers the classes which hold the Ribbon controls such as SfRibbon, SfRibbonMenu, SfRibbonGalleryItem etc.
+Contains the Ribbon control classes such as SfRibbon, SfRibbonMenu, and SfRibbonGalleryItem.
Syncfusion.SfTabControl.UWP.dll
-Covers the classes which hold the controls like SfTabControl, SfTabItem etc
+Contains the tab control classes such as SfTabControl and SfTabItem.
Syncfusion.XlsIO.UWP.dll
-Contains the base classes which are responsible for reading and writing in Excel files, Worksheet Manipulations, Formula calculations etc.
+Contains the base classes responsible for reading and writing Excel files, worksheet manipulation, and formula calculation.
-Below are the assemblies list that can be added when you want to enable certain features in SfSpreadsheet control.
+
+The following optional assemblies enable additional features such as charts and sparklines:
@@ -88,15 +97,15 @@ Description
Syncfusion.SfSpreadsheetHelper.UWP.dll
-Contains the classes which are responsible for importing charts and sparklines into SfSpreadsheet
+Contains the classes responsible for importing charts and sparklines into SfSpreadsheet.
Syncfusion.ExcelChartToImageConverter.UWP.dll
-Contains the classes which are responsible for converting charts as image
+Contains the classes responsible for converting charts to images.
Syncfusion.SfChart.UWP.dll
-Contains the classes which are responsible for importing charts like Line charts, Pie charts, Sparklines etc.
+Contains the classes responsible for importing chart types such as line charts, pie charts, and sparklines.
{% endtabcontent %}
@@ -107,19 +116,21 @@ Contains the classes which are responsible for importing charts like Line charts
UWP Spreadsheet control can be added to an application either through the designer (XAML) or programmatically using code.
+N> In all of the XAML snippets below, replace `YourNamespace` (in `xmlns:local="using:YourNamespace"` and `x:Class="YourNamespace.MainPage"`) with the actual namespace of your project (for example, `App1`).
+
{% tabcontents %}
{% tabcontent Via Designer %}
-1.Click and open the MainPage.xaml file.
+1. Open the **MainPage.xaml** file.
-2.Open the Visual Studio **Tool** **box**. Navigate to “Syncfusion® Controls for UWP” tab and find the SfSpreadsheet/SfSpreadsheetRibbon toolbox items.
+2. Open the Visual Studio **Toolbox**. Navigate to the **Syncfusion® Controls for UWP** tab and find the **SfSpreadsheet** / **SfSpreadsheetRibbon** toolbox items.

-3.Drag `SfSpreadsheet` and drop in to the Designer area from the Toolbox.
+3. Drag **SfSpreadsheet** from the Toolbox and drop it into the Designer area.
-_For_ _Spreadsheet:_
+**For Spreadsheet:**
{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" %}
@@ -143,11 +154,11 @@ _For_ _Spreadsheet:_
{% endhighlight %}
{% endtabs %}
-N> Declare a name for the Spreadsheet component as shown above for reference.
+N> Assign a name (for example, `spreadsheet`) so you can reference the control from code-behind.
-4.Ribbon can be added to the application by dragging and dropping `SfSpreadsheetRibbon` to the Designer area.
+4. Drag **SfSpreadsheetRibbon** from the Toolbox and drop it into the Designer area.
-_For_ _Ribbon:_
+**For Ribbon:**
{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" %}
@@ -266,15 +277,16 @@ N> To load the SfSpreadsheet in Windows Mobile, add the above code in MainPage.x
{% endtabcontents %}
-## Run the application
+## Build and run the application
-Press Ctrl+F5 (Windows) or ⌘+F5 (macOS) to launch the application. The output will appear as follows:
+1. Build the solution by pressing Ctrl+Shift+B (or *Build → Build Solution*). Resolve any missing-reference errors that appear in the **Error List**.
+2. To launch the application without the debugger, press Ctrl+F5. The output will appear as follows:

-To learn how to create, open, and save files in the UWP Spreadsheet Component, see [Workbook Operations.](Workbook-Operations)
+To learn how to create, open, and save files in the UWP Spreadsheet Component, see [Workbook Operations](Workbook-Operations.md).
-N> [View Sample in GitHub](https://github.com/SyncfusionExamples/uwp-spreadsheet-examples).
+N> [View the UWP Spreadsheet sample in GitHub](https://github.com/SyncfusionExamples/uwp-spreadsheet-examples).
## See Also
-- [Display Charts and Sparklines ](Shapes)
+* [Display Charts and Sparklines](Shapes.md)
diff --git a/Document-Processing/Excel/Spreadsheet/Vue/getting-started.md b/Document-Processing/Excel/Spreadsheet/Vue/getting-started.md
index d6d105aff2..ba6909333f 100644
--- a/Document-Processing/Excel/Spreadsheet/Vue/getting-started.md
+++ b/Document-Processing/Excel/Spreadsheet/Vue/getting-started.md
@@ -1,7 +1,7 @@
---
layout: post
-title: Getting started with Vue Spreadsheet component | Syncfusion
-description: Checkout and learn about getting started with the Syncfusion Vue Spreadsheet component in the Spreadsheet Editor SDK and more details.
+title: Getting started with Vue 2 Spreadsheet component | Syncfusion
+description: Check out and learn about getting started with the Syncfusion Vue Spreadsheet component in the Spreadsheet Editor SDK and more details.
control: Getting started
platform: document-processing
documentation: ug
@@ -15,7 +15,7 @@ This article provides a step-by-step guide for setting up a Vue 2 project and in
[System requirements for Vue components](https://ej2.syncfusion.com/vue/documentation/system-requirements)
-## Create a Vue application
+## Create a Vue Application
Use [Vue CLI](https://cli.vuejs.org/#getting-started) to set up a Vue application, as it provides a modular project architecture, flexible configuration, and an integrated plugin system.
@@ -32,41 +32,43 @@ vue create quickstart
cd quickstart
```
-> When prompted during project creation, select **Default ([Vue 2] babel, eslint)**.
+> When prompted during project creation, select **Default ([Vue 2] babel, eslint)** to scaffold a Vue 2 project. (If you are using **Vue 3**, refer to the [Getting Started with the Vue 3 Spreadsheet Component](./vue-3-getting-started) instead.)
## Install the Vue Spreadsheet package
Install the [Vue Spreadsheet Editor](https://www.npmjs.com/package/@syncfusion/ej2-vue-spreadsheet) package from npm using the following command:
```
-npm install @syncfusion/ej2-vue-spreadsheet --save
+npm install @syncfusion/ej2-vue-spreadsheet
```
## Add CSS references
-Add the following Spreadsheet and dependent component CSS styles in the **\
-# Syncfusion® license key validation in CI services
+# Overview of Syncfusion license validation in CI services
-Syncfusion® license key validation in CI services ensures that Syncfusion® Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. Set up the continuous integration process to fail in case the license key validation fails. Validate the passed parameters and the registered license key again to resolve the issue.
+Validating the Syncfusion® license key as part of your CI pipeline ensures that Syncfusion® Essential Studio components are properly licensed before deployment and helps prevent licensing errors in production. The following sections describe how to validate the license key in Azure Pipelines, GitHub Actions, and Jenkins, and how to validate it programmatically using the `ValidateLicense()` method or a unit test project.
The following section shows how to validate the Syncfusion® license key in CI services.
* Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip).
-* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor as shown in the below example.
+* Open the LicenseKeyValidation.ps1 PowerShell script in a text or code editor as shown in the following example.
+
{% tabs %}
-{% highlight c# tabtitle="PowerShell" %}
+{% highlight c# tabtitle="v34.1.29 and later" %}
+# Replace the parameters with the desired platform, version, and actual license key.
+
+$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"WordToPDF" /version:"34.1.29" /licensekey:"Your License Key"
+
+Write-Host $result
+{% endhighlight %}
+
+{% highlight c# tabtitle="v31.1.17 to v33.2.3" %}
+# Replace the parameters with the desired platform, version, and actual license key.
+
+$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"WordToPDF" /version:"31.1.17" /licensekey:"Your License Key"
+
+Write-Host $result
+{% endhighlight %}
+
+{% highlight c# tabtitle="Before v31.1.17" %}
# Replace the parameters with the desired platform, version, and actual license key.
$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"FileFormats" /version:"26.2.4" /licensekey:"Your License Key"
@@ -37,28 +54,28 @@ Write-Host $result
{% endhighlight %}
{% endtabs %}
-
+* Update the parameters in the script:
+
+ **Platform:** Set /platform:"**WordToPDF**" for v34.1.29 and later and v31.1.17 to v33.2.3, or /platform:"**FileFormats**" for before v31.1.17 (use the relevant Syncfusion platform as needed).
-* Update the parameters in the LicenseKeyValidation.ps1 script file as described below.
+ **Version:** Change the value for `/version:` to the required version (for example, `26.2.4`).
- **Platform:** Modify the value for /platform: to the actual platform "FileFormats".
-
- **Version:** Change the value for /version: to the required version (e.g., "26.2.4").
-
- **License Key:** Replace the value for /licensekey: with your actual license key (e.g., "Your License Key").
-
- N> This feature is supported only from the 16.2.0.41 version of the Essential Studio®.
+ **License Key:** Replace the value for `/licensekey:` with your actual license key (for example, `Your License Key`). To keep the key out of source control, store it as a CI secret and read it in the script (for example, `$env:SYNCFUSION_LICENSE_KEY`).
+
+ N> This feature is supported starting with version 16.2.0.41 of Essential Studio®.
+
+ N> On Windows agents, if script execution is blocked by policy, run the script with `-ExecutionPolicy Bypass` (for example, `powershell -ExecutionPolicy Bypass -File .\LicenseKeyValidation.ps1`). The script returns a non-zero exit code when validation fails so the pipeline step fails.
## Azure Pipelines (YAML)
-* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
+* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as the value (for example, `D:\LicenseKeyValidator\LicenseKeyValidation.ps1`).
-* Integrate the PowerShell task in the pipeline and execute the script to validate the license key.
+Integrate the PowerShell task in the pipeline and execute the script to validate the license key.
The following example shows the syntax for Windows build agents.
{% tabs %}
-{% highlight c# tabtitle="YAML" %}
+{% highlight yaml tabtitle="YAML" %}
pool:
vmImage: 'windows-latest'
@@ -75,21 +92,21 @@ steps:
## Azure Pipelines (Classic)
-* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
+* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as the value (for example, `D:\LicenseKeyValidator\LicenseKeyValidation.ps1`). Store the license key as a secret variable (for example, `SYNCFUSION_LICENSE_KEY`).
-* Include the PowerShell task in the pipeline and execute the script to validate the license key.
+* Add a PowerShell task that runs the script. Mark the build to fail when the script's exit code is non-zero so the pipeline reflects validation failures.

-## GitHub actions
+## GitHub Actions
-* To execute the script in PowerShell as part of a GitHub Actions workflow, include a step in the configuration file and update the path of the LicenseKeyValidation.ps1 script file (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
+* To execute the script in PowerShell as part of a GitHub Actions workflow, add a step in the workflow YAML file. Update the path of the LicenseKeyValidation.ps1 script file (for example, `./path/LicenseKeyValidator/LicenseKeyValidation.ps1`) and store the license key in a repository or organization secret named `SYNCFUSION_LICENSE_KEY`.
-The following example shows the syntax for validating the Syncfusion® license key in GitHub actions.
+The following example shows the syntax for validating the Syncfusion® license key in GitHub Actions.
{% tabs %}
-{% highlight c# tabtitle="YAML" %}
- steps:
+{% highlight yaml tabtitle="YAML" %}
+steps:
- name: Syncfusion License Validation
shell: pwsh
run: |
@@ -99,9 +116,9 @@ The following example shows the syntax for validating the Syncfusion®
## Jenkins
-* Create an [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
+* Create an [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named `LICENSE_VALIDATION`. Use the path of the LicenseKeyValidation.ps1 script file as the value (for example, `D:\LicenseKeyValidator\LicenseKeyValidation.ps1` on Windows agents or `/var/lib/jenkins/LicenseKeyValidator/LicenseKeyValidation.ps1` on Linux agents).
-* Include a stage in Jenkins to execute the LicenseKeyValidation.ps1 script in PowerShell.
+* Add a stage that runs the `LicenseKeyValidation.ps1` script in PowerShell. The example below targets a Linux agent and uses the `sh` step; on Windows agents use the `bat` step with `pwsh`.
The following example shows the syntax for validating the Syncfusion® license key in the Jenkins pipeline.
@@ -125,41 +142,64 @@ pipeline {
## Validate the License Key By Using the ValidateLicense() Method
-* Register the license key properly by calling RegisterLicense("License Key") method with the license key.
+* Register the license key by calling `SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY")` before any Syncfusion control is instantiated.
-* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.FileFormats") method. This ensures that the license key is valid for the platform and version you are using. For reference, please check the following example.
+* After registration, validate the key with `SyncfusionLicenseProvider.ValidateLicense(Platform.FileFormats)`, passing the `Platform` enum value that matches your application. This confirms the license is valid for the platform and version in use. The method returns `true` on success and `false` on failure; in overloads that include an `out string validationMessage` parameter, the message describes the failure reason. See the following examples for the correct signature by version.
{% tabs %}
-{% highlight c# %}
+{% highlight csharp tabtitle="v34.1.29 and later" %}
+using Syncfusion.Licensing;
+
+// Register the Syncfusion license key
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+// Validate the registered license key.
+// The array overload allows validating against multiple platforms in a single call.
+bool isValid = SyncfusionLicenseProvider.ValidateLicense(new[] { Platform.WordToPDF });
+{% endhighlight %}
+
+{% highlight csharp tabtitle="v31.1.17 to v33.2.3" %}
+using Syncfusion.Licensing;
+
+// Register the Syncfusion license key
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+
+// Validate the registered license key
+bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.WordToPDF);
+{% endhighlight %}
+
+{% highlight csharp tabtitle="Before v31.1.17" %}
using Syncfusion.Licensing;
-//Register Syncfusion license key
-Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
+// Register the Syncfusion license key
+SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
-//Validate the registered license key
+// Validate the registered license key
bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.FileFormats);
{% endhighlight %}
{% endtabs %}
-
+N> Use the specific platform enum (`PDF`, `Word`, `Excel`, `PowerPoint`, `WordToPDF`, `ExcelToPDF`, or `PowerPointToPDF`) for license validation from v31.1.17 and later. `Platform.FileFormats` is not supported from v31.1.17 onwards.
+
+* If the `ValidateLicense()` method returns `true`, the registered license key is valid and the build can proceed with deployment.
-* If the ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
+* If the `ValidateLicense()` method returns `false`, the build produces invalid license errors. Validation fails when the license key is invalid or the referenced Syncfusion assembly or package versions do not match the version of the license key. Ensure that all referenced Syncfusion® assemblies or NuGet packages share the same version as the license key before deployment.
-* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion® assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
+## Validate the License Key By Using the Unit Test Project
-## Validate the License Key By Using the Unit Test Project
+* To create a unit test project in Visual Studio, choose **File -> New -> Project** from the menu. This opens a new dialog for creating a new project. Filter the project type by Test, or type **Test** as a keyword in the search option, to find available unit test projects. Select the appropriate test framework (such as MSTest, NUnit, or xUnit) that best suits your need.
-* To create a unit test project in Visual Studio, choose **File -> New -> Project** from the menu. This opens a new dialog for creating a new project. Filtering the project type by Test or typing Test as a keyword in the search option can help you to find available unit test projects. Select the appropriate test framework (such as MSTest, NUnit, or xUnit) that best suits your need.
+* Add the required Syncfusion references to the test project. The example below uses NUnit, so install the NUnit and NUnit3TestAdapter NuGet packages, then add the `Syncfusion.Licensing` package and the File-Formats platform package (for example, `Syncfusion.PdfToPdfAConverter` or the platform package relevant to your project) at the same version as your license key.

* For more details on creating unit test projects in Visual Studio, refer to the [Getting Started with Unit Testing guide](https://learn.microsoft.com/en-us/visualstudio/test/getting-started-with-unit-testing?view=vs-2022&tabs=dotnet%2Cmstest#create-unit-tests).
-* Register the license key by calling the RegisterLicense("Your License Key") method with the license key in the unit test project.
+* Register the license key by calling `SyncfusionLicenseProvider.RegisterLicense("Your License Key")` in the unit test project. Register the key before any Syncfusion control is instantiated so the validation reflects the runtime configuration.
-N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
+N> Enclose the license key in double quotes. Also, ensure that `Syncfusion.Licensing` (the `Syncfusion.Licensing.dll` assembly) is referenced in the project where the license key is registered. For .NET Core/5+ projects, add the `Syncfusion.Licensing` NuGet package; for .NET Framework projects, reference `Syncfusion.Licensing.dll` from the installed Essential Studio assemblies.
-* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.FileFormats", out var validationMessage) method. This ensures that the license key is valid for the platform and version you are using.
+* Once the license key is registered, it can be validated by using the `ValidateLicense(Platform.FileFormats, out string validationMessage)` method. The `validationMessage` out parameter describes the failure reason when the result is `false`, which makes troubleshooting easier in unit-test output.
* For reference, please check the following example that demonstrates how to register and validate the license key in the unit test project.
@@ -183,12 +223,12 @@ public void TestSyncfusionFileFormatsLicense()
{% endhighlight %}
{% endtabs %}
-* Once the unit test is executed, if the license key validation passes for the specified platform, the output similar to the following will be displayed in the Test Explorer window.
+* Once the unit test is executed, if the license key validation passes for the specified platform, output similar to the following is displayed in the **Test Explorer** window.

-* If the license validation fails during unit testing, the following output will be displayed in the Test Explorer window.
+* If the license validation fails during unit testing, output similar to the following is displayed in the **Test Explorer** window.

-* License validation fails due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. In such cases, verify that you are using the valid license key for the platform, and ensure the assembly or package versions referenced in the project match the version of the license key.
\ No newline at end of file
+* Validation fails when the license key is invalid or the referenced Syncfusion assembly or package versions do not match the version of the license key. Verify that you are using a valid key for the platform and that all referenced Syncfusion packages share the same version as the license key.
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Assemblies-Required.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Assemblies-Required.md
index 653f7bd449..6e7e01642c 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Assemblies-Required.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Assemblies-Required.md
@@ -8,7 +8,7 @@ documentation: UG
# Assemblies Required to work with PDFToImageConverter
-TThe following assemblies need to be referenced in your application based on the platform.
+The following assemblies need to be referenced in your application based on the target platform.
-
+
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-Core.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-Core.md
index b88314c9b3..d7a782c36e 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-Core.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-Core.md
@@ -22,17 +22,16 @@ The Syncfusion® PDF to Image converter is a .NET library used to convert PDF
* Visual Studio 2022.
* Install [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later.
+N> If you want to use the PdfToImageConverter in the Linux environment, you need to install the [SkiaSharp.NativeAssets.Linux v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1) NuGet package as reference to your applications from [NuGet.org](https://www.nuget.org).
Step 1: Create a new C# ASP.NET Core Web Application project.

-Step 2: In configuration windows, name your project and select Next.
+Step 2: In configuration windows, name your project and select Next.


-Step 3: Install [Syncfusion.PdfToImageConverter.Net.Core](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net.Core/) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
-
-N> If you want to use the PdfToImageConverter in the Linux environment, you need to install the [SkiaSharp.NativeAssets.Linux v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1) NuGet package as reference to your applications from [NuGet.org](https://www.nuget.org/).
+Step 3: Install [Syncfusion.PdfToImageConverter.Net.Core](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
Step 4: A default controller with name HomeController.cs gets added on creation of ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
@@ -40,6 +39,7 @@ Step 4: A default controller with name HomeController.cs gets added on creation
{% highlight C# %}
using Syncfusion.PdfToImageConverter;
+using System.IO;
{% endhighlight %}
{% endtabs %}
@@ -61,7 +61,7 @@ Step 5: Add a new button in index.cshtml as shown below.
{% endhighlight %}
{% endtabs %}
-Step 6: Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class.
+Step 6: Copy the sample PDF file (Input.pdf) to your project root and set its Copy to Output Directory property to Copy if newer. Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class. The Convert parameters specify the page index (0 = first page), keep-foreground, and anti-aliasing flags. The supported output format is PNG by default.
{% tabs %}
{% highlight C# %}
@@ -101,33 +101,34 @@ Click the Start button (green arrow) or press F5 to run the app.
* Install [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later.
* Open Visual Studio Code and install the [C# for Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) from the Extensions Marketplace.
+N> If you want to use the PdfToImageConverter in the Linux environment, you need to install the [SkiaSharp.NativeAssets.Linux v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1) NuGet package as reference to your applications from [NuGet.org](https://www.nuget.org).
Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new ASP.NET Core application
```
dotnet new mvc -n CreatePdfToImageConvertASPNETCoreAPP
```
-Step 2: Replace ****CreatePdfToImageConvertASPNETCoreAPP** with your desired project name.
+
+Step 2: Replace **CreatePdfToImageConvertASPNETCoreAPP** with your desired project name.
Step 3: Navigate to the project directory using the following command
```
cd CreatePdfToImageConvertASPNETCoreAPP
```
-Step 4: Use the following command in the terminal to add the [Syncfusion.PdfToImageConverter.Net] (https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net) package to your project.
+Step 4: Use the following command in the terminal to add the [Syncfusion.PdfToImageConverter.Net](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net) package to your project.
```
dotnet add package Syncfusion.PdfToImageConverter.Net
```
-N> If you want to use the PdfToImageConverter in the Linux environment, you need to install the [SkiaSharp.NativeAssets.Linux v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1) NuGet package as reference to your applications from [NuGet.org](https://www.nuget.org/).
-
Step 5: A default controller with name HomeController.cs gets added on creation of ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
{% tabs %}
{% highlight C# %}
using Syncfusion.PdfToImageConverter;
+using System.IO;
{% endhighlight %}
{% endtabs %}
@@ -149,7 +150,7 @@ Step 6: A default action method named Index will be present in HomeController.cs
{% endhighlight %}
{% endtabs %}
-Step 7: Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class.
+Step 7: Copy the sample PDF file (Input.pdf) to your project root before running. Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class. The Convert parameters specify the page index (0 = first page), keep-foreground, and anti-aliasing flags. The supported output format is PNG by default.
{% tabs %}
{% highlight C# %}
@@ -181,7 +182,7 @@ dotnet build
Step 9: Run the project.
-Run the following command in terminal to build the project.
+Run the following command in terminal to run the project.
```
dotnet run
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-MVC.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-MVC.md
index d0ea5d72e9..72d024e0b1 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-MVC.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-ASP-NET-MVC.md
@@ -1,6 +1,6 @@
---
title: Convert PDF file to Image in ASP.NET MVC | Syncfusion®
-description: Learn how to convert a PDF file to Image in ASP.NET MVC with easy steps using System Drawing library.
+description: Learn how to convert a PDF file to an image in ASP.NET MVC with easy steps using the System.Drawing library.
platform: document-processing
control: PDF to image
documentation: UG
@@ -9,11 +9,11 @@ keywords: Assemblies
# Convert PDF file to Image in ASP.NET MVC
-The Syncfusion® PDF to Image converter is a .NET library used to convert PDF document to image in ASP.NET MVC application.
+The Syncfusion® PDF to Image converter is a .NET library used to convert a PDF document to an image in ASP.NET MVC application.
## Steps to convert PDF document to Image in ASP.NET MVC
-Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project.
+Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project and select the **MVC** template.

Step 2: In the project configuration windows, name your project and select Create.
@@ -51,7 +51,7 @@ Step 5: Add a new button in the Index.cshtml as shown below.
{% endhighlight %}
{% endtabs %}
-Step 6: Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class.
+Step 6: Add a new action method named ExportToImage in HomeController.cs and include the below code example to convert PDF document to Image using Convert method in PdfToImageConverter class. Ensure the **Input.pdf** file is available in the application's working directory before running the conversion.
{% tabs %}
{% highlight C# %}
@@ -70,4 +70,4 @@ return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Image.Jpeg, "sample
{% endtabs %}
By executing the program, you will get the image as follows.
-
+
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Blazor.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Blazor.md
index 180f8915ff..986fa64f3a 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Blazor.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Blazor.md
@@ -1,6 +1,6 @@
---
title: Convert PDF file to Image in Blazor | Syncfusion®
-description: Learn how to convert a PDF file to Image in Blazor with easy steps using Syncfusion® PDF TO Image Converter library.
+description: Learn how to convert a PDF file to Image in Blazor with easy steps using Syncfusion® PDF to Image Converter library.
platform: document-processing
control: PDF to image
documentation: UG
@@ -39,6 +39,7 @@ Step 4: Create a new razor component named ConvertPDFToImage under Pages folder.
{% highlight razor tabtitle="~/ConvertPDFToImage.razor" %}
@using Syncfusion.PdfToImageConverter;
+@using System.IO;
{% endhighlight %}
{% endtabs %}
@@ -105,12 +106,12 @@ Click the Start button (green arrow) or press F5 to run the app.
* Install [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later.
* Open Visual Studio Code and install the [C# for Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) from the Extensions Marketplace.
-Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new Blazor Server application
+Step 1: Open the terminal (Ctrl+`) and run the following command to create a new Blazor Server application
```
dotnet new blazorserver -n CreatePdfToImageConverterBlazorServerApp
```
-Step 2: Replace ****CreatePdfToImageConverterBlazorServerApp** with your desired project name.
+Step 2: Replace **CreatePdfToImageConverterBlazorServerApp** with your desired project name.
Step 3: Navigate to the project directory using the following command
@@ -141,6 +142,7 @@ Step 6: Create a new razor component named ConvertPDFToImage under Pages folder.
{% highlight razor tabtitle="~/ConvertPDFToImage.razor" %}
@using Syncfusion.PdfToImageConverter;
+@using System.IO;
{% endhighlight %}
{% endtabs %}
@@ -179,7 +181,7 @@ private void ExportToImage()
{% endhighlight %}
{% endtabs %}
-Step 9: Add ConvertPDFToImage.razor file in index.razor.
+Step 8: Add ConvertPDFToImage.razor file in index.razor.
{% tabs %}
{% highlight razor tabtitle="~/index.razor" %}
@@ -189,7 +191,7 @@ Step 9: Add ConvertPDFToImage.razor file in index.razor.
{% endhighlight %}
{% endtabs %}
-Step 10: Build the project.
+Step 9: Build the project.
Run the following command in terminal to build the project.
@@ -197,9 +199,9 @@ Run the following command in terminal to build the project.
dotnet build
```
-Step 11: Run the project.
+Step 10: Run the project.
-Run the following command in terminal to build the project.
+Run the following command in terminal to run the project.
```
dotnet run
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-WPF.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-WPF.md
index e717afbba5..4113bd28c1 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-WPF.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-WPF.md
@@ -9,14 +9,14 @@ keywords: Assemblies
# Convert PDF file to Image in WPF
-The Syncfusion® PDF to Image converter is a .NET library used to convert PDF document to image in WPF application.
+The Syncfusion® PDF to Image converter is a .NET library used to convert a PDF document to an image in a WPF application.
## Steps to convert PDF document to Image in WPF
Step 1: Create a new WPF application project.

-In project configuration window, name your project and select Create.
+In the project configuration window, name your project and select Create.

Step 2: Install the [Syncfusion.PdfToImageConverter.WPF](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.WPF/) NuGet package as a reference to your WPF application [NuGet.org](https://www.nuget.org/).
@@ -37,10 +37,10 @@ using System.Windows;
Step 4: Add a new button in MainWindow.xaml to convert PDF document to Image file as follows.
{% tabs %}
-{% highlight C# %}
+{% highlight XAML %}
-
+
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Windows-Forms.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Windows-Forms.md
index fbd38e1eb7..bb495b0c64 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Windows-Forms.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-file-to-Image-in-Windows-Forms.md
@@ -9,7 +9,7 @@ keywords: Assemblies
# Convert PDF file to Image in Windows Forms
-The Syncfusion® PDF to Image converter is a .NET library used to convert PDF document to image in WPF application.
+The Syncfusion® PDF to Image converter is a .NET library used to convert PDF document to image in Windows Forms application.
## Steps to convert PDF document to Image in Windows Forms
@@ -73,6 +73,7 @@ Step 5: Include the following namespaces in the Form1.cs file.
using Syncfusion.PdfToImageConverter;
using System.Drawing;
+using System.IO;
{% endhighlight %}
{% endtabs %}
@@ -82,17 +83,21 @@ Step 6: Create the btnCreate_Click event and add the following code in btnCreate
{% tabs %}
{% highlight C# %}
-//Initialize PDF to Image converter.
-PdfToImageConverter imageConverter = new PdfToImageConverter();
-//Load the PDF document as a stream
-FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
-imageConverter.Load(inputStream);
-//Convert PDF to Image.
-Stream outputStream = imageConverter.Convert(0, false, false);
-Bitmap image = new Bitmap(outputStream);
-image.Save("sample.png");
+private void btnCreate_Click(object sender, EventArgs e)
+{
+ //Initialize PDF to Image converter.
+ PdfToImageConverter imageConverter = new PdfToImageConverter();
+ //Load the PDF document as a stream
+ FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
+ imageConverter.Load(inputStream);
+ //Convert PDF to Image.
+ Stream outputStream = imageConverter.Convert(0, false, false);
+ Bitmap image = new Bitmap(outputStream);
+ image.Save("sample.png");
+}
+
{% endhighlight %}
{% endtabs %}
-By executing the program, you will get the PDF document as follows.
-
+By executing the program, you will get the Image as follows.
+
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-to-Image.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-to-Image.md
index 10baa7a442..049ec82245 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-to-Image.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Convert-PDF-to-Image.md
@@ -1,21 +1,21 @@
---
-title: Convert PDF to Image| Syncfusion®
-description: Learn how to convert a PDF document to Image file with easy steps using Syncfusion® PDFToImageConverter library.
+title: Convert PDF to Image | Syncfusion®
+description: Learn how to convert a PDF document to an image file with simple steps using Syncfusion® PdfToImageConverter library.
platform: document-processing
control: PDF to image
documentation: UG
-keywords: Assemblies
+keywords: PDF to Image, PdfToImageConverter, Convert method
---
# Convert PDF to Image
-This PDF to image converter library allows converting PDF documents to images without opening the document in the PDF Viewer control. It allows you to selectively export pages as a stream by utilizing the 'Convert' method, facilitating the transformation of PDF files into images.
+This PDF to image converter library allows converting PDF documents to images without opening the document in the PDF Viewer control. It allows you to selectively export pages as a stream by using the `Convert` method, which transforms the PDF file into an image.
Watch the following video to quickly get started with converting PDF to image in .NET using a PDF to Image Converter Library.
{% youtube "https://www.youtube.com/watch?v=Grjtyh5gBr8" %}
-The following code snippet illustrates how to convert PDF page into image using Convert method in PdfToImageConverter.
+The following code snippet illustrates how to convert a PDF page into an image using the `Convert` method in `PdfToImageConverter`.
{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/WPF-PDFViewer-Examples/master/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs" %}
@@ -62,4 +62,4 @@ image.Save("sample.png")
{% endtabs %}
-You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/PDF-to-image).
+You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/PDF-to-image).
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-Core.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-Core.md
index 0b3b5496a9..1649cb2e65 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-Core.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-Core.md
@@ -17,6 +17,10 @@ You can export a single page from a PDF file as an image by specifying the page
{% tabs %}
{% highlight C# %}
+using Syncfusion.PdfToImageConverter;
+using System.IO;
+using System.Drawing;
+
//Initialize PDF to Image converter.
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
@@ -24,6 +28,13 @@ FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.R
imageConverter.Load(inputStream);
//Convert PDF to Image.
Stream outputStream = imageConverter.Convert(0, false, false);
+//Save the image to disk.
+using (FileStream fileStream = new FileStream("Output.png", FileMode.Create, FileAccess.Write))
+{
+ outputStream.CopyTo(fileStream);
+}
+outputStream.Dispose();
+inputStream.Dispose();
{% endhighlight %}
{% endtabs %}
@@ -35,24 +46,42 @@ You can export a specific range of PDF pages into images by specifying the start
{% tabs %}
{% highlight C# %}
+using Syncfusion.PdfToImageConverter;
+using System.IO;
+using System.Drawing;
+
//Initialize PDF to Image converter.
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
imageConverter.Load(inputStream);
//Convert PDF to Image.
-Stream[] outputStream = imageConverter.Convert(0, imageConverter.PageCount-1, false, false);
+Stream[] outputStreams = imageConverter.Convert(0, imageConverter.PageCount-1, false, false);
+//Save the images to disk.
+for (int i = 0; i < outputStreams.Length; i++)
+{
+ using (FileStream fileStream = new FileStream("Output_" + i + ".png", FileMode.Create, FileAccess.Write))
+ {
+ outputStreams[i].CopyTo(fileStream);
+ }
+ outputStreams[i].Dispose();
+}
+inputStream.Dispose();
{% endhighlight %}
{% endtabs %}
## Exporting with a custom image size
-You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG image. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
+You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
{% tabs %}
{% highlight C# %}
+using Syncfusion.PdfToImageConverter;
+using System.IO;
+using System.Drawing;
+
//Initialize PDF to Image converter.
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
@@ -60,6 +89,13 @@ FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.R
imageConverter.Load(inputStream);
//Convert PDF to Image.
Stream outputStream = imageConverter.Convert(0, new SizeF(1836, 2372), false, false, false);
+//Save the image to disk.
+using (FileStream fileStream = new FileStream("Output.png", FileMode.Create, FileAccess.Write))
+{
+ outputStream.CopyTo(fileStream);
+}
+outputStream.Dispose();
+inputStream.Dispose();
{% endhighlight %}
{% endtabs %}
@@ -88,6 +124,13 @@ FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.R
imageConverter.Load(inputStream);
//Convert PDF to Image.
Stream outputStream = imageConverter.Convert(0, zoomFactor, tileXCount, tileYCount, tileX, tileY);
+//Save the image to disk.
+using (FileStream fileStream = new FileStream("Output.png", FileMode.Create, FileAccess.Write))
+{
+ outputStream.CopyTo(fileStream);
+}
+outputStream.Dispose();
+inputStream.Dispose();
{% endhighlight %}
{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-MVC.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-MVC.md
index 58fc1b92df..ebf202c8e5 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-MVC.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-ASP-NET-MVC.md
@@ -10,7 +10,7 @@ documentation: UG
PdfToImageConverter allows you to convert pages from a PDF document into images using the Convert method. You can convert either a single page or pages into images.
-## Converting a single page into image
+## Converting a single page into an image
You can export a single page from a PDF file as an image by specifying the page index and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output image, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output image, set the `isSkipAnnotations` parameter to true. Refer to the following code to export a single page of PDF into PNG image.
@@ -48,7 +48,7 @@ Stream[] outputStream = imageConverter.Convert(0, imageConverter.PageCount-1, fa
## Exporting with a custom image size
-You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG image. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
+You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency`, `isSkipAnnotations`, and `keepAspectRatio` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. To maintain the aspect ratio of the output images, set the `keepAspectRatio` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
{% tabs %}
{% highlight C# %}
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Blazor.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Blazor.md
index b412c523b0..1b2ec26696 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Blazor.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Blazor.md
@@ -48,7 +48,7 @@ Stream[] outputStream = imageConverter.Convert(0, imageConverter.PageCount-1, fa
## Exporting with a custom image size
-You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG image. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
+You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency`, `isSkipAnnotations`, and `keepAspectRatio` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations from the output images, set the `isSkipAnnotations` parameter to true. To maintain the aspect ratio of the output image, set the `keepAspectRatio` parameter to true. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
{% tabs %}
{% highlight C# %}
@@ -68,7 +68,7 @@ N> To maintain the aspect ratio of output images, you are required to pass the v
## Exporting with a custom image resolution
-You can export PDF pages as images with specific attributes, such as zoom factor, tile dimensions (x and y), and tile matrix co-ordinates (x and y), by passing the corresponding values as parameters to the Convert method. zoomFactor is used to specify the zoom level. The number of columns and rows will be calculated based on tileXCount and tileYCount (tile dimensions), while tile x and y co-ordinates determine which tile to use based on tileX and tileY. The ScaleFactor property scales the page to enhance image quality, and it can be set to positive floating-point values, with recommended values of 1 or 1.5f. Refer to the following code for exporting PDF pages into PNG images with the desired resolution.
+You can export PDF pages as images with specific attributes, such as zoom factor, tile dimensions (x and y), and tile matrix coordinates (x and y), by passing the corresponding values as parameters to the Convert method. zoomFactor is used to specify the zoom level. The number of columns and rows will be calculated based on tileXCount and tileYCount (tile dimensions), while tile x and y coordinates determine which tile to use based on tileX and tileY. The ScaleFactor property scales the page to enhance image quality, and it can be set to positive floating-point values, with recommended values of 1 or 1.5f. Refer to the following code for exporting PDF pages into PNG images with the desired resolution.
{% tabs %}
{% highlight C# %}
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-WPF.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-WPF.md
index 654984d985..7b51adb8d2 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-WPF.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-WPF.md
@@ -10,7 +10,7 @@ documentation: UG
PdfToImageConverter allows you to convert pages from a PDF document into images using the Convert method. You can convert either a single page or pages into images.
-## Converting a single page into image
+## Converting a single page into an image
You can export a single page from a PDF file as an image by specifying the page index and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output image, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output image, set the `isSkipAnnotations` parameter to true. Refer to the following code to export a single page of PDF into PNG image.
@@ -55,7 +55,7 @@ for(int i=0; i < outputStream.Length; i++)
## Exporting with a custom image size
-You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG image. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
+You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
{% tabs %}
{% highlight C# %}
@@ -77,7 +77,7 @@ N> To maintain the aspect ratio of output images, you are required to pass the v
## Exporting with a custom image resolution
-You can export PDF pages as images with custom horizontal and vertical resolutions by specifying the desired `DpiX` and `DpiY` values and configuring the `keepTransparency` and `isSkipAnnotations` parameters in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG images with the horizontal and vertical resolution of 200 respectively.
+You can export PDF pages as images with custom horizontal and vertical resolutions by specifying the desired `DpiX` and `DpiY` values and configuring the `keepTransparency` and `isSkipAnnotations` parameters in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG images with the horizontal and vertical resolution of 200, respectively.
{% tabs %}
{% highlight C# %}
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Windows-Forms.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Windows-Forms.md
index de2bc14d24..0985bd41b5 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Windows-Forms.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images-in-Windows-Forms.md
@@ -8,9 +8,9 @@ documentation: UG
# Converting PDF pages into images in Windows Forms
-PdfToImageConverter allows you to convert pages from a PDF document into images using the Convert method. You can convert either a single page or pages into images.
+PdfToImageConverter allows you to convert pages from a PDF document into images using the Convert method. You can convert either a single page or multiple pages into images.
-## Converting a single page into image
+## Converting a single page into an image
You can export a single page from a PDF file as an image by specifying the page index and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output image, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output image, set the `isSkipAnnotations` parameter to true. Refer to the following code to export a single page of PDF into PNG image.
@@ -55,7 +55,7 @@ for(int i=0; i < outputStream.Length; i++)
## Exporting with a custom image size
-You can export PDF pages as images with custom width and height by passing the required size and setting the parameters `keepTransparency` and `isSkipAnnotations` in the Convert method. To preserve transparency in the output images, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output images, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the pages of PDF into PNG image. Refer to the following code to export the page at the index of 0 into PNG image with the width and the height of 1836 and 2372 in pixels respectively.
+You can export a PDF page as an image with custom width and height by passing the required size and setting the parameters `keepAspectRatio`, `keepTransparency`, and `isSkipAnnotations` in the Convert method. To preserve the aspect ratio of the output image, make sure to set the `keepAspectRatio` parameter to true. To preserve transparency in the output image, make sure to set the `keepTransparency` parameter to true. If you want to exclude annotations and form field elements from the output image, set the `isSkipAnnotations` parameter to true. Refer to the following code to export the page at the index of 0 into a PNG image with a width of 1836 pixels and a height of 2372 pixels.
{% tabs %}
{% highlight C# %}
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images.md
index 664a974a1e..308cb2a70c 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Converting-PDF-pages-into-Images.md
@@ -1,5 +1,5 @@
---
-title: Converting PDF pages into images| Syncfusion®
+title: Converting PDF pages into images | Syncfusion®
description: Learn about Converting PDF pages into images using Syncfusion® Essential Studio® PdfToImageConverter Library.
platform: document-processing
control: PDF to image
@@ -8,10 +8,10 @@ documentation: UG
# Converting PDF pages into images
-PdfToImageConverter allows you to convert pages from a PDF document into images. The 'convert' methods for different platforms are documented at the redirection links below
+PdfToImageConverter allows you to convert pages from a PDF document into images. The 'convert' methods for different platforms are documented in the platform-specific guides linked below:
* [ASP.NET Core](Converting-PDF-pages-into-Images-in-ASP-NET-Core)
* [ASP.NET MVC](Converting-PDF-pages-into-Images-in-ASP-NET-MVC)
* [Blazor](Converting-PDF-pages-into-Images-in-Blazor)
* [Windows Forms](Converting-PDF-pages-into-Images-in-Windows-Forms)
-* [WPF](Converting-PDF-pages-into-Images-in-WPF)
+* [WPF](Converting-PDF-pages-into-Images-in-WPF)
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Multithreading-PDF-to-Image-Converter-Library.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Multithreading-PDF-to-Image-Converter-Library.md
index 92d1599ecd..62f0371b66 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Multithreading-PDF-to-Image-Converter-Library.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Multithreading-PDF-to-Image-Converter-Library.md
@@ -8,22 +8,22 @@ documentation: UG
# How to perform multithreading in the PdfToImageConverter library
-To perform multithreading and thread-safety support in opening PDF documents and saving image file are listed below.
+The steps to perform multithreading and ensure thread-safety when opening PDF documents and saving image files are listed below.
## Does the PdfToImageConverter library support multithreading and thread-safety?
-Yes, the Syncfusion® PdfToImageConverter library is thread-safe, allowing you to create multiple instances of the [PdfToImageConverter]() class to load the same file as multiple copies or different PDF documents and save the images using multithreading in C#.
+Yes, the Syncfusion® PdfToImageConverter library is thread-safe, allowing you to create multiple instances of the PdfToImageConverter class to load the same file as multiple copies or different PDF documents and save the images using multithreading in C#.
### Multithreading PDF document reading using tasks
-The following code example illustrates how to use multithreading to open PDF documents and and saving image file by creating multiple tasks in C#.
+The following code example illustrates how to use multithreading to open PDF documents and save image files by creating multiple tasks in C#.
{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
class MultiThreading
{
- //Indicates the number of threads to be create.
+ //Indicates the number of threads to be created.
private const int TaskCount = 1000;
public static async Task Main()
{
@@ -65,7 +65,7 @@ class MultiThreading
{% highlight c# tabtitle="C# [Windows-specific]" %}
class MultiThreading
{
- //Indicates the number of threads to be create.
+ //Indicates the number of threads to be created.
private const int TaskCount = 1000;
public static async Task Main()
{
@@ -106,7 +106,7 @@ class MultiThreading
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
Module MultiThreading
- 'Indicates the number of threads to be create.
+ 'Indicates the number of threads to be created.
Private Const TaskCount As Integer = 1000
Public Sub Main()
'Create an array of tasks based on the TaskCount.
@@ -152,13 +152,13 @@ class MultiThreading
{
static void Main(string[] args)
{
- //Indicates the number of threads to be create.
+ //Indicates the number of threads to be created.
int limit = 50;
Console.WriteLine("Parallel For Loop");
Parallel.For(0, limit, count =>
{
Console.WriteLine("Task {0} started", count);
- //Create multiple PDF document, one document on each thread.
+ //Create multiple PDF documents, one document on each thread.
ConvertPdfToImage(count);
Console.WriteLine("Task {0} is done", count);
});
@@ -193,13 +193,13 @@ class MultiThreading
{
static void Main(string[] args)
{
- //Indicates the number of threads to be create.
+ //Indicates the number of threads to be created.
int limit = 50;
Console.WriteLine("Parallel For Loop");
Parallel.For(0, limit, count =>
{
Console.WriteLine("Task {0} started", count);
- //Create multiple PDF document, one document on each thread.
+ //Create multiple PDF documents, one document on each thread.
ConvertPdfToImage(count);
Console.WriteLine("Task {0} is done", count);
});
@@ -233,12 +233,12 @@ class MultiThreading
Module MultiThreading
Public Sub Main(args As String())
'Indicates the number of threads to be created.
- Dim limit As Integer = 5
+ Dim limit As Integer = 50
Console.WriteLine("Parallel For Loop")
'Parallel For Loop
Parallel.For(0, limit, Sub(count)
Console.WriteLine("Task {0} started", count)
- 'Create multiple PDF document, one document on each thread.
+ 'Create multiple PDF documents, one document on each thread.
ConvertPdfToImage(count)
Console.WriteLine("Task {0} is done", count)
End Sub)
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Run-NET80-Linux-application-in-azure-app-service.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Run-NET80-Linux-application-in-azure-app-service.md
index 479860d0f7..bbf67314f1 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Run-NET80-Linux-application-in-azure-app-service.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/How-to/Run-NET80-Linux-application-in-azure-app-service.md
@@ -1,6 +1,6 @@
---
-title: Run .NET80/.NET90 Linux application in azure app service| Syncfusion®
-description: Learn about the steps to run the .NET80/.NET90 linux application in Azure app service with the PdfToImageConverter library.
+title: Run .NET 8.0/.NET 9.0 in Azure App Service | Syncfusion®
+description: Learn about the steps to run the .NET 8.0/.NET 9.0 Linux application in Azure App Service with the PdfToImageConverter library.
platform: document-processing
control: PDF to image
documentation: UG
@@ -10,27 +10,27 @@ documentation: UG
To run a .NET 8.0/.NET 9.0 Linux application with PdfToImageConverter on an Azure App Service, you need the libdl.so file to access the pdfium assembly. However, in Azure App Service, the file is named libdl.so.2 instead of libdl.so. Therefore, to ensure compatibility and functionality, you must manually move and rename libdl.so.2 to libdl.so in the Azure App Service environment for the .NET 8.0/.NET 9.0 applications. This adjustment allows your .NET 8.0/.NET 9.0 application to function properly with PdfToImage conversion capabilities.
-N> While running the .NET 8.0/.NET 9.0 PdfToImageConverter Linux application on a Azure app service, you will get the `TypeInitializationException: Type initializer for "Syncfusion.PdfToImageConverter.PdfiumNative" threw an exception`.
+N> While running the .NET 8.0/.NET 9.0 PdfToImageConverter Linux application on an Azure App Service, you will get the `TypeInitializationException: Type initializer for "Syncfusion.PdfToImageConverter.PdfiumNative" threw an exception`.
-## Steps to run the .NET8/.NET9 PdfToImageConverter Linux application in Azure app service
+## Steps to run the .NET 8/.NET 9 PdfToImageConverter Linux application in Azure App Service
-Step 1: Open the SSH command window which will be present under your Azure app service in [Azure portal](https://portal.azure.com/).
+Step 1: Open the SSH command window available in your Azure App Service from the [Azure portal](https://portal.azure.com).

-Step 2: Now, navigate back to the home location and then navigate to the usr/lib/x86_64-linux-gnu location in the SSH.
+Step 2: Navigate to the home location and then navigate to the `usr/lib/x86_64-linux-gnu` location in the SSH.

-Step 3: List the assemblies present in this location using the `ls` command. You can find the libdl.so.2 assembly in that location instead of libdl.so assembly file.
+Step 3: List the files present in this location using the `ls` command. You can find the libdl.so.2 file in that location instead of the libdl.so file.

-Step 4: Copy the libdl.so.2 file from this location to the `home\site\wwwroot` folder and rename it to libdl.so using the command `cp libdl.so.2 /home/site/wwwroot/libdl.so`.
+Step 4: Copy the libdl.so.2 file from this location to the `/home/site/wwwroot` folder and rename it to libdl.so using the command `cp libdl.so.2 /home/site/wwwroot/libdl.so`.

-Step 5: Then navigate back to the `home\site\wwwroot` folder and ensure whether the copied assembly present in the desired location.
+Step 5: Then navigate back to the `/home/site/wwwroot` folder and verify that the copied file is present in the desired location.

-Step 6: Finally, refresh the service page URL and then the application will be work as expected.
+Step 6: Finally, refresh the service page URL and the application will work as expected.
-N> If still the service is not working properly, stop and start the service again in the Azure portal. The `TypeInitializationException` will no longer be thrown.
+N> If the service is still not working properly, stop and start the service again in the Azure portal. The `TypeInitializationException` will no longer be thrown.
-N> When running a PDFToImageConverter inside an Alpine-based Docker environment, you may encounter a runtime exception System.DllNotFoundException. `libdl.so` assembly is unavailable in Alpine Linux. Without the `libdl.so` file, we cannot read the Pdfium assembly. Therefore, it is not possible to use `PdfToImageConverter` in an Alpine Docker environment.
\ No newline at end of file
+N> When running a PdfToImageConverter inside an Alpine-based Docker environment, you may encounter a runtime exception `System.DllNotFoundException`. The `libdl.so` file is unavailable in Alpine Linux. Without the `libdl.so` file, we cannot read the Pdfium assembly. Therefore, it is not possible to use `PdfToImageConverter` in an Alpine Docker environment.
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Loading-document.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Loading-document.md
index 6484785ff7..f08236f107 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Loading-document.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Loading-document.md
@@ -5,7 +5,7 @@ platform: document-processing
control: PDF to image
documentation: UG
---
-# Load PDF file in C#
+# Load a PDF File Using C#
User can load a PDF as a stream using PdfToImageConverter, and then we can convert the PDF pages into images.
@@ -44,7 +44,7 @@ imageConverter.Load(inputPDFStream);
## Loading an Encrypted PDF document using constructor
-You can load an existing encrypted document to PdfToImageConverter. When creating an instance of the PdfToImageConverter class, pass the PDF document as a stream and the password required to decrypt the provided PDF file. The following example shows how to load an existing enrypted document from a stream using the constructor.
+You can load an existing encrypted document to PdfToImageConverter. When creating an instance of the PdfToImageConverter class, pass the PDF document as a stream and the password required to decrypt the provided PDF file. The following example shows how to load an existing encrypted document from a stream using the constructor.
{% tabs %}
@@ -60,13 +60,13 @@ PdfToImageConverter imageConverter = new PdfToImageConverter(inputPDFStream, "pa
## Loading an Encrypted PDF document using load method
-You can load an existing encrypted document into PdfToImageConverter.When using the 'load' method of the PdfToImageConverter class, pass the PDF document as a stream and the password required to decrypt the provided PDF file. The following example shows how to load an existing enrypted document from a stream using the 'load' method.
+You can load an existing encrypted document into PdfToImageConverter. When using the 'load' method of the PdfToImageConverter class, pass the PDF document as a stream and the password required to decrypt the provided PDF file. The following example shows how to load an existing encrypted document from a stream using the 'load' method.
{% tabs %}
{% highlight c# tabtitle="C#" %}
-//Load an encrypted PDF document from stream through constructor of `PdfToImageConverter` class.
+//Load an encrypted PDF document from stream through load method of `PdfToImageConverter` class.
PdfToImageConverter imageConverter = new PdfToImageConverter();
FileStream inputPDFStream = new FileStream(@"Input.pdf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
imageConverter.Load(inputPDFStream, "password");
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/NuGet-Packages-Required.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/NuGet-Packages-Required.md
index 550f42c271..9bf6f563dd 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/NuGet-Packages-Required.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/NuGet-Packages-Required.md
@@ -6,23 +6,24 @@ control: PDF to image
documentation: UG
---
-# NuGet Packages Required
+# NuGet Packages Required
-To work with PDF to image converter library, the following NuGet packages need to be installed in your application.
+To work with the PDFToImageConverter library, the following NuGet packages need to be installed in your application.
-N> The above mentioned NuGet packages are available in [nuget.org](https://www.nuget.org/).
+N> The above-mentioned NuGet packages are available in [nuget.org](https://www.nuget.org/).
\ No newline at end of file
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Referring-PDFium.md b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Referring-PDFium.md
index 3812203483..e504964132 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/NET/Referring-PDFium.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/NET/Referring-PDFium.md
@@ -9,7 +9,7 @@ documentation: UG
# Convert PDF to image using PDFium
-PdfToImageConverter use PDFium to convert pdf document as image. PDFium is used in Google Chrome for rendering PDF files. It provides accurate and robust PDF rendering.
+PdfToImageConverter uses PDFium to convert a PDF document to an image. PDFium is used in Google Chrome for rendering PDF files. It provides accurate and robust PDF rendering.
N>* PDFium is not supported in Windows XP operating system.
N>* From v34.1.x onwards, Pdfium is upgraded to the new version which was built with the branch [chromium/7814](https://pdfium.googlesource.com/pdfium/+/refs/heads/chromium/7814).
@@ -18,25 +18,25 @@ N>* From v34.1.x onwards, Pdfium is upgraded to the new version which was built
* On running your application, Syncfusion® PdfToImageConverter control generates a folder named `PDFium` in the application output path folder (for example: bin/release or bin/debug) at runtime.
* Syncfusion® PdfToImageConverter control detects the architecture of the running machine automatically.
-For WPF, WinForms and MVC, Pdfium folder structure will be generated as below,
-* Next, it creates another subfolder named “x64”, “x86” or “arm64” based on the machine architecture.
+* For WPF, WinForms and MVC, the PDFium folder structure will be generated as shown below.
+* Next, it creates another subfolder named "x64", "x86" or "arm64" based on the machine architecture.
* Extracts the PDFium binary (PDFium.dll) into the subfolder (x64, x86 or arm64) and consumes it to render PDF files.

-N> For Syncfusion.PdfToImageConverter.Net and Syncfusion.PdfToImageConverter.Net.Core NuGet packages, Extractions of PDFium will not occur.
+N> For Syncfusion.PdfToImageConverter.Net and Syncfusion.PdfToImageConverter.Net.Core NuGet packages, extraction of PDFium will not occur.
-N> When you include PdfToImageConverter via a NuGet package, PDFium assemblies will automatically be generated in the application's output path folder from the NuGet package during compilation
+N> When you include PdfToImageConverter via a NuGet package, PDFium assemblies will automatically be generated in the application's output path folder from the NuGet package during compilation.
## How to run PDFium in a restricted access environment
-If there is any access restriction applied to the application output folder, then the Syncfusion® PDF To Image Converter cannot able to extract and consume the PDFium engine.
+If there is any access restriction applied to the application output folder, then the Syncfusion® PdfToImageConverter cannot extract and consume the PDFium engine.
In that situation, you need to add the following steps to consume the PDFium.
* Create a folder where your application can access, create & read files. For example, "d:\ThirdPartyBinaries\".
-* Update the path of this folder to the ReferencePath property of PdfToImageConverter control, like shown in the following code sample.
-* If ReferencePath is set, then PdfToImageConverter extracts the PDFium binary inside that specified folder and consume the PDFium rendering engine.
+* Update the path of this folder to the ReferencePath property of PdfToImageConverter control, as shown in the following code sample.
+* If ReferencePath is set, then PdfToImageConverter extracts the PDFium binary inside that specified folder and consumes the PDFium rendering engine.
{% tabs %}
{% highlight c# %}
diff --git a/Document-Processing/PDF/Conversions/PDF-to-image/overview.md b/Document-Processing/PDF/Conversions/PDF-to-image/overview.md
index 95a97174ab..bfbeefd6c3 100644
--- a/Document-Processing/PDF/Conversions/PDF-to-image/overview.md
+++ b/Document-Processing/PDF/Conversions/PDF-to-image/overview.md
@@ -28,7 +28,7 @@ Watch the following video to quickly get started with converting PDF to image in
Windows Forms
N> The above mentioned NuGet packages are available in [nuget.org](https://www.nuget.org/).
-The following code snippet illustrates how to convert PDF page into image using Convert method in PdfToImageConverter.
+The following code snippet illustrates how to convert a PDF page into an image using the `Convert` method in `PdfToImageConverter`. The `Convert` method accepts the page index, a flag to keep the original aspect ratio, and a flag to include annotations in the output image.
{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
+using System.IO;
+using Syncfusion.PdfToImageConverter;
+
//Initialize PDF to Image converter.
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
imageConverter.Load(inputStream);
-//Convert PDF to Image.
+//Convert PDF to Image. Parameters: pageIndex, keepAspectRatio, showAnnotations
Stream outputStream = imageConverter.Convert(0, false, false);
MemoryStream stream = outputStream as MemoryStream;
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Image.Jpeg, "sample.jpeg");
@@ -79,26 +81,35 @@ return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Image.Jpeg, "sample
{% highlight c# tabtitle="C# [Windows-specific]" %}
+using System.IO;
+using System.Drawing;
+using System.Drawing.Imaging;
+using Syncfusion.PdfToImageConverter;
+
//Initialize PDF to Image converter.
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
imageConverter.Load(inputStream);
-//Convert PDF to Image.
+//Convert PDF to Image. Parameters: pageIndex, keepAspectRatio, showAnnotations
Stream outputStream = imageConverter.Convert(0, false, false);
Bitmap image = new Bitmap(outputStream);
image.Save("sample.png");
-
{% endhighlight %}
{% highlight vb tabtitle="VB.NET [Windows-specific]" %}
+Imports System.IO
+Imports System.Drawing
+Imports System.Drawing.Imaging
+Imports Syncfusion.PdfToImageConverter
+
'Initialize PDF to Image converter.
Dim imageConverter As PdfToImageConverter = New PdfToImageConverter()
'Load the PDF document as a stream
Dim inputStream As FileStream = New FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite)
imageConverter.Load(inputStream)
-'Convert PDF to Image.
+'Convert PDF to Image. Parameters: pageIndex, keepAspectRatio, showAnnotations
Dim outputStream As Stream = imageConverter.Convert(0, False, False)
Dim image As Bitmap = New Bitmap(outputStream)
image.Save("sample.png")
@@ -107,4 +118,4 @@ image.Save("sample.png")
{% endtabs %}
-You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/PDF-to-image).
+You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/PDF-to-image).
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md
index f85413bbe9..63d938f09a 100644
--- a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md
+++ b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md
@@ -108,7 +108,6 @@ N> 2. From the Essential Studio® 2018 Volume 3 release(v16.3.0.21
For advanced PDF features like compression, redaction, PDF/A conversion, image extraction, and OCR, include the corresponding Syncfusion® imaging package in your .NET Core applications:
-
@@ -139,6 +138,38 @@ For advanced PDF features like compression, redaction, PDF/A conversion, image e
+To convert XPS documents to PDF, install the following required NuGet packages in your .NET application.
+
+
+
+
+
Platform(s)
+
NuGet Package
+
+
+
+
+
+ ASP.NET Core (Targeting NET Core)
+ Console Application (Targeting .NET Core)
+ Blazor
+
@@ -182,7 +213,6 @@ The following table illustrates the native assets NuGet package with their match
Common Linux distributions such as Ubuntu, Alpine, CentOS, Debian, Fedora, and RHEL
Azure App Service
Google App Engine
-
diff --git a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md
index dfe0965ead..4e97dfebc8 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md
@@ -16,7 +16,7 @@ Check the following video to quickly get started with creating a Flutter PDF doc
## Steps to create PDF document in Flutter application
-Create a simple project using the instructions given in the [`Getting Started with your first Flutter app'](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation.
+Create a simple project using the instructions given in the [`Getting Started with your first Flutter app`](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation.
**Add dependency**
@@ -38,9 +38,9 @@ N> Here **xx.x.xx** denotes the current version of [`Syncfusion Flutter PDF`](ht
Run the following command to get the required packages.
{% tabs %}
-{% highlight dart tabtitle="dart" %}
+{% highlight powershell tabtitle="POWERSHELL" %}
-$ flutter pub get
+flutter pub get
{% endhighlight %}
{% endtabs %}
@@ -67,8 +67,8 @@ Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton(
- onPressed: _createPDF,
- child: Text('Create PDF')
+ onPressed: _createPDF,
+ child: Text('Create PDF'),
),
),
);
@@ -113,7 +113,7 @@ You can save and open a PDF document in desktop by using the following steps:
Configure and enable the desktop support to run the app.
{% tabs %}
-{% highlight dart tabtitle="dart" %}
+{% highlight dart tabtitle="dart" %}
flutter config --enable--desktop
@@ -129,10 +129,10 @@ Here you can get more details about [`How to add desktop support in the app`](ht
Add the following packages to your pub spec file.
{% tabs %}
-{% highlight dart tabtitle="dart" %}
+{% highlight dart tabtitle="dart" %}
-path_provider: ^1.6.5
-open_file: ^3.0.1
+path_provider: ^2.0.7
+open_file: ^3.2.1
{% endhighlight %}
{% endtabs %}
@@ -275,11 +275,11 @@ Add the following code in the header section of index.html file under the web fo
## Save and download a PDF document in WASM
-step 1: Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file.
+**Step 1:** Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file.
-step 2: Create a new Dart file called **save_file_wasm.dart**.
+**Step 2:** Create a new Dart file called **save_file_wasm.dart**.
-step 3: Add the following code:
+**Step 3:** Add the following code:
**Import package**
diff --git a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md
index 9e3680c4e1..174655811d 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md
@@ -1,13 +1,13 @@
---
layout: post
-title: Open and save PDF file in Flutter PDF library | Syncfusion
-description: Learn here all about Open and save PDF file feature of Syncfusion Flutter PDF non-UI library and more.
+title: Open and save a PDF file in Flutter PDF library | Syncfusion
+description: Learn here all about Open and save a PDF file feature of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
---
-# Open and save PDF file in Flutter PDF
+# Open and save a PDF file in Flutter PDF
## Opening an existing PDF document
@@ -15,7 +15,7 @@ You can open an existing PDF document by using the [`PdfDocument`](https://pub.d
{% tabs %}
{% highlight dart tabtitle="dart" %}
-
+import 'dart:io';
//Opens an existing document from the list of bytes
PdfDocument document =
PdfDocument(inputBytes: File('input.pdf').readAsBytesSync());
@@ -23,21 +23,20 @@ PdfDocument document =
{% endhighlight %}
{% endtabs %}
-## Opening an existing PDF document from the base 64 string
+## Opening an existing PDF document from the Base64 string
-You can open an existing document from the base 64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below.
+You can open an existing document from the Base64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below.
{% tabs %}
{% highlight dart tabtitle="dart" %}
-
-//Opens an existing document from the base 64 string
+//Opens an existing document from the Base64 string
PdfDocument document = PdfDocument.fromBase64String(
'JVBERi0xLjcNCiWDkvr+DQoxIDAgb2JqDQo8PA0KL1R5cGUgL0NhdGFsb2cNCi9QYWdlcyAyIDAgUg0KPj4NCmVuZG9iag0KMiAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0tpZHMgWzMgMCBSXQ0KL0NvdW50IDENCi9SZXNvdXJjZXMgPDw+Pg0KDQovTWVkaWFCb3ggWzAgMCA1OTUgODQyXQ0KPj4NCmVuZG9iag0KMyAwIG9iag0KPDwNCi9Db3VudCAxDQovVHlwZSAvUGFnZXMNCi9LaWRzIFs0IDAgUl0NCi9QYXJlbnQgMiAwIFINCj4+DQplbmRvYmoNCjQgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KPj4NCmVuZG9iag0KeHJlZg0KMCA1DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTcgMDAwMDAgbg0KMDAwMDAwMDA3MiAwMDAwMCBuDQowMDAwMDAwMTgwIDAwMDAwIG4NCjAwMDAwMDAyNTkgMDAwMDAgbg0KdHJhaWxlcg0KPDwNCi9Sb290IDEgMCBSDQovU2l6ZSA1DQo+Pg0KDQpzdGFydHhyZWYNCjMxMg0KJSVFT0Y=');
{% endhighlight %}
{% endtabs %}
-## Saving a PDF document to list of bytes
+## Saving a PDF document to a list of bytes
You can save the manipulated PDF document as a list of bytes using the [`save`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html) method of [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class. Also, you can save the list of bytes to the file system as follows.
@@ -55,4 +54,4 @@ List bytes =await document.save();
File('output.pdf').writeAsBytes(bytes);
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/overview.md b/Document-Processing/PDF/PDF-Library/flutter/overview.md
index d3729928ab..0010675bb2 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/overview.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/overview.md
@@ -9,21 +9,21 @@ documentation: ug
# Flutter PDF Overview
-The Syncfusion® Flutter PDF is a library written natively in Dart for creating the PDF documents from scratch. The library can be used in Flutter Mobile and Web platforms without the dependency of Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and latest PDF 2.0 (ISO 32000-2) specifications.
+The Syncfusion® Flutter PDF is a library written natively in Dart for creating PDF documents from scratch. It can be used in Flutter Mobile and Web platforms without requiring Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and the latest PDF 2.0 (ISO 32000-2) specifications.
Check the following video for a quick overview of Syncfusion Flutter UI Widgets and File Format Packages.
{% youtube "https://youtu.be/FwUSJtv-3NY?si=doGR-fOkvghf-UUa" %}
## Key features of Syncfusion® Flutter PDF:
-* Support to create PDF files from scratch.
-* Support to add text and drawing shapes.
-* Support to add ordered and unordered lists.
-* Support to draw raster images like JPEG and PNG formats.
-* Support to add hyperlink and document link annotations.
-* Support to add tables.
-* Support to add headers and footers in PDF document.
-* Support to add bookmarks in PDF document.
-* Support to protect PDF document by encryption.
+* Creates PDF files from scratch.
+* Adds text and draws shapes.
+* Adds ordered and unordered lists.
+* Draws raster images such as JPEG and PNG formats.
+* Adds hyperlink and document link annotations.
+* Adds tables.
+* Adds headers and footers in PDF documents.
+* Adds bookmarks in PDF documents.
+* Protects PDF documents with encryption.
You can get the sample from this link: [`Flutter PDF`](https://github.com/syncfusion/flutter-examples).
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md
index 357d7c47ca..ec2e1beae4 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md
@@ -254,8 +254,8 @@ PdfPage page = document.pages.add();
//Creates a new document link annotation
PdfDocumentLinkAnnotation documentLinkAnnotation =
PdfDocumentLinkAnnotation(Rect.fromLTWH(10, 40, 30, 30),
- setAppearance: true,
- PdfDestination(document.pages.add(), Offset(10, 0)));
+ PdfDestination(document.pages.add(), Offset(10, 0)),
+ setAppearance: true);
//Adds this annotation the page.
page.annotations.add(documentLinkAnnotation);
@@ -305,7 +305,7 @@ document.dispose();
This annotation is used to navigate to a particular web URI while clicking on the link text.
-The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLinkAnnotation.
+The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLink.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -415,7 +415,7 @@ Pop-up annotation displays text in a pop-up window for entry and editing.
It typically does not appear alone but is associated with markup annotation, its parent annotation.
-PdfPopupAnnotation is used to add pop-up annotation in a PDF document.
+PdfPopupAnnotation is used to add a pop-up annotation in a PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -471,9 +471,9 @@ document.dispose();
## Flatten annotation
-Annotations can be flattened by removing the existing annotation and replacing it with the graphics objects that would resemble the annotation and it cannot be edited.
+Annotations can be flattened by removing the existing annotation and replacing it with graphics objects that resemble the annotation, making it non-editable.
-This can be achieved by enabling the flattenAllAnnotations method . Please refer to the sample for flattening all the annotations in the PDF document.
+This can be achieved by calling the flattenAllAnnotations method. Please refer to the sample for flattening all the annotations in the PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -571,7 +571,7 @@ annotation.innerColor = PdfColor(0, 255, 0);
annotation.text = 'Modified Annotation';
annotation.author = 'Syncfusion';
annotation.modifiedDate = DateTime.now();
-annotation.setAppearance: true;
+annotation.setAppearance = true;
//Saves the document
File('output.pdf').writeAsBytes(await document.save());
@@ -652,7 +652,7 @@ If set, do not display the annotation on the screens or allow the user to intera
readOnly
-If set, do not allow the user to interact with annotation.
+If set, do not allow the user to interact with the annotation.
locked
@@ -660,7 +660,7 @@ If set, do not allow the annotation to be deleted or its properties to be modifi
toggleNoView
-If set, invert the interpretation of the noView flat for certain events.
+If set, invert the interpretation of the noView flag for certain events.
@@ -793,11 +793,11 @@ To export annotation data to the FDF file from the PDF document, you can use the
//Load an existing PDF document.
PdfDocument document =
PdfDocument(inputBytes: File('input.pdf').readAsBytesSync());
- //Export the annotations to FDF file format
+ //Export the annotations to FDF file format.
List bytes = document.exportAnnotation(PdfAnnotationDataFormat.fdf);
//Save the FDF file.
File('export.fdf').writeAsBytesSync(bytes);
- //Dispose the document
+ //Dispose the document.
document.dispose();
{% endhighlight %}
@@ -815,7 +815,7 @@ To export annotation data to the XFDF file from the PDF document, you can use th
PdfDocument(inputBytes: File('input.pdf').readAsBytesSync());
//Export the annotations to XFDF file format.
List bytes = document.exportAnnotation(PdfAnnotationDataFormat.xfdf);
- //Save the FDF file.
+ //Save the XFDF file.
File('export.xfdf').writeAsBytesSync(bytes);
//Dispose the document.
document.dispose();
@@ -835,10 +835,10 @@ To export annotation data to the JSON file from the PDF document, you can use th
PdfDocument(inputBytes: File('input.pdf').readAsBytesSync());
//Export the annotations to JSON file format.
List bytes = document.exportAnnotation(PdfAnnotationDataFormat.json);
- //Save the FDF file.
+ //Save the JSON file.
File('export.json').writeAsBytesSync(bytes);
//Dispose the document.
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md
index 6ca44eeb2f..8d4823d301 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md
@@ -1,7 +1,7 @@
---
layout: post
title: Attachments in Flutter PDF library | Syncfusion
-description: Learn here all about add, remove, and load the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn here all about add, remove, and extract the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -111,7 +111,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Extracting and saving an attachment to the disc
+## Extracting and saving an attachment to the disk
The Syncfusion® Flutter PDF provides support for extracting the attachments and saving them to the disk. The following code example explains how to extract and save an attachment.
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md
index e513b9d967..4cbff61e61 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md
@@ -9,7 +9,7 @@ documentation: ug
# Bookmarks in Flutter PDF
-The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF Document.
+The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF document.
## Adding bookmarks to a PDF
@@ -18,7 +18,7 @@ The [`PdfBookmarkBase`](https://pub.dev/documentation/syncfusion_flutter_pdf/lat
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF document
+//Creates a new PDF document
PdfDocument document = PdfDocument();
//Creates document bookmark
@@ -30,13 +30,13 @@ bookmark.destination = PdfDestination(document.pages.add(), Offset(100, 100));
//Sets the text style
bookmark.textStyle = [PdfTextStyle.bold];
-//Sets the bookmark color(RGB)
+//Sets the bookmark color (RGB)
bookmark.color = PdfColor(255, 0, 0);
-//Save the document
+//Saves the document
File('Output.pdf').writeAsBytes(await document.save());
-//Dispose the document
+//Disposes the document
document.dispose();
{% endhighlight %}
@@ -49,10 +49,10 @@ You can add a child bookmark by using the [`insert`](https://pub.dev/documentati
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF document
+//Creates a new PDF document
PdfDocument document = PdfDocument();
-//Add a page
+//Adds a page
PdfPage page = document.pages.add();
//Creates document bookmark
@@ -72,16 +72,16 @@ childBookmark2.textStyle = [PdfTextStyle.italic];
childBookmark1.destination = PdfDestination(page, Offset(100, 100));
childBookmark2.destination = PdfDestination(page, Offset(100, 400));
-//Sets the bookmark color(RGB)
+//Sets the bookmark color (RGB)
childBookmark1.color = PdfColor(0, 255, 0);
childBookmark2.color = PdfColor(0, 0, 255);
-//Saves the bookmark
+//Saves the document
File('Output.pdf').writeAsBytes(await document.save());
-//Dispose the document
+//Disposes the document
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
@@ -176,8 +176,7 @@ document.dispose();
## Modifying bookmarks in an existing PDF
-The Syncfusion®
- Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document.
+The Syncfusion® Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document.
* Modify the bookmark style, color, title, and destination.
* Add or insert new bookmarks into the root collection.
@@ -217,4 +216,4 @@ File('output.pdf').writeAsBytes(await document.save());
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md
index bb36c9beb9..bfca662d06 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md
@@ -9,7 +9,7 @@ documentation: ug
# Digital Signature in Flutter PDF
-Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally by using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign.
+Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign.
## Adding a digital signature
@@ -18,17 +18,17 @@ To add a digital signature, you need a certificate with private keys. The follow
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Creates a new PDF document
+//Creates a new PDF document.
PdfDocument document = PdfDocument();
-//Adds a new page
+//Adds a new page.
PdfPage page = document.pages.add();
-//Creates a digital signature and sets signature information
+//Creates a digital signature and sets signature information.
PdfSignatureField field = PdfSignatureField(page, 'signature',
bounds: Rect.fromLTWH(0, 0, 200, 100),
signature: PdfSignature(
- //Creates a certificate instance from the PFX file with a private key
+ //Creates a certificate instance from the PFX file with a private key.
certificate:
PdfCertificate(File('PDF.pfx').readAsBytesSync(), 'password123'),
contactInfo: 'johndoe@owned.us',
@@ -37,10 +37,10 @@ PdfSignatureField field = PdfSignatureField(page, 'signature',
digestAlgorithm: DigestAlgorithm.sha256,
cryptographicStandard: CryptographicStandard.cms));
-//Add a signature field to the form
+//Add a signature field to the form.
document.form.fields.add(field);
-//Save and dispose the PDF document
+//Save and dispose the PDF document.
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
@@ -117,6 +117,8 @@ document.dispose();
You can sign the PDF document from an external digital signature created from various sources such as cloud services like DigitalSign.
+The `addExternalSigner` method on `PdfSignature` accepts a custom signer (an implementation of `IPdfExternalSigner`) and a list of public-certificate bytes that are used to generate the message digest to be signed.
+
The following code example shows how to sign the PDF document from an external signature.
{% tabs %}
@@ -148,10 +150,10 @@ You can create an external digital signature with the [`x509`](https://pub.dev/p
**Add dependency**
-Add this to your package's pubspec.yaml file.
+Add the following dependency to your `pubspec.yaml` file and then run `flutter pub get`.
{% tabs %}
-{% highlight dart tabtitle="dart" %}
+{% highlight yaml tabtitle="yaml" %}
dependencies:
x509: ^0.1.4
@@ -167,12 +169,14 @@ dependencies:
import 'package:x509/x509.dart' as x509;
{% endhighlight %}
+{% endtabs %}
You can compute the signed message digest by using the x509 package with a corresponding private key of the public certificate.
+{% tabs %}
{% highlight dart %}
-//Class for singing a PDF document externally.
+//Class for signing a PDF document externally.
class PdfExternalSigner extends IPdfExternalSigner {
//Hash algorithm.
@override
@@ -194,14 +198,14 @@ class PdfExternalSigner extends IPdfExternalSigner {
{% endhighlight %}
{% endtabs %}
-You can use the sign method in IPdfExternalSigner for asynchronous signing.
+You can use the sign method in `IPdfExternalSigner` for asynchronous signing.
-N> Asynchronous signing will only work when saving the PDF document asynchronously. signSync works with synchronous and asynchronous save methods.
+N> The asynchronous `sign` method only works when the PDF document is saved asynchronously (using `await document.save()`). The `signSync` method can be used with both `document.save()` and `document.saveSync()`.
{% tabs %}
{% highlight dart tabtitle="dart" %}
- //Class for singing a PDF document externally.
+ //Class for signing a PDF document externally.
class PdfExternalSigner extends IPdfExternalSigner {
//Hash algorithm.
@override
@@ -223,7 +227,7 @@ N> Asynchronous signing will only work when saving the PDF document asynchronous
{% endhighlight %}
{% endtabs %}
-## Adding multiple digital signature
+## Adding multiple digital signatures
You can apply one or more digital signatures to a PDF document. The following code example shows how to add multiple signatures to the PDF document.
@@ -278,7 +282,7 @@ The Syncfusion® Flutter PDF supports creating long term signature
N> The resulting PDF document size will be substantial because all the necessary signature information, Certificate Revocation List (CRL), and Online Certificate Status Protocol (OCSP) are embedded.
-The following code example shows how to enable LTV for a signed PDF document using createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class.
+The following code example shows how to enable LTV for a signed PDF document using the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -298,9 +302,9 @@ The following code example shows how to enable LTV for a signed PDF document usi
{% endhighlight %}
{% endtabs %}
-## Create Long Term Validation (LTV) with public certificates data
+## LTV with public certificates data
-The following code example shows how to create an LTV for a signed PDF document using public certificates with the createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class.
+The following code example shows how to create an LTV for a signed PDF document using public certificates with the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The `publicCertificatesData` parameter accepts the chain of certificates returned by `PdfCertificate.getCertificateChain()`, and the `includePublicCertificates` flag controls whether the certificates are embedded into the signed document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -327,12 +331,13 @@ The following code example shows how to create an LTV for a signed PDF document
{% endhighlight %}
{% endtabs %}
-## Adding a timestamp in digital signature
+## Adding a timestamp in a digital signature
+
+Use this approach when you are creating a new digital signature and want the signature itself to carry a trusted timestamp from a `TimestampServer` (a TSA URL, with optional `userName`, `password`, and `timeOut`).
-The Syncfusion®
- Flutter PDF allows you to add timestamp in the digital signature of the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
+The Syncfusion® Flutter PDF allows you to add a timestamp in the digital signature of the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
-N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
+N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -378,11 +383,13 @@ N> Signing using TimestampServer only works when the document is saved using asy
{% endhighlight %}
{% endtabs %}
-## Adding a timestamp in the PDF document
+## Adding a timestamp to the PDF document
+
+Use this approach when you need to add a trusted timestamp to a PDF document without binding it to a certificate-based signature.
-You can add timestamp to the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
+You can add a timestamp to the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
-N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
+N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -416,11 +423,13 @@ N> Signing using TimestampServer only works when the document is saved using asy
{% endhighlight %}
{% endtabs %}
-## Adding a timestamp in an existing PDF document
+## Adding a timestamp to an existing PDF document
-You can add timestamp to the existing PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
+Use this approach when the document already exists and you need to attach a trusted timestamp without re-signing with a certificate.
-N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
+You can add a timestamp to the existing PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same.
+
+N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html).
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -450,4 +459,4 @@ N> Signing using TimestampServer only works when the document is saved using asy
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md
index 459e64835e..a963bc2c50 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md
@@ -18,7 +18,7 @@ You can choose the standard or custom page size when you add a page to the PDF d
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Set the page size
@@ -33,7 +33,7 @@ document.pages.add().graphics.drawString(
//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
@@ -42,7 +42,7 @@ You can create a PDF document with custom page size by using the following code
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Set the page size
@@ -53,19 +53,19 @@ document.pages.add().graphics.drawString(
'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 19),
brush: PdfBrushes.mediumVioletRed);
-//Save and close the PDF document
+//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
-You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from [`portrait`] to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet.
+You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from portrait to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet.
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Set the page size
@@ -80,10 +80,10 @@ document.pages.add().graphics.drawString(
brush: PdfBrushes.mediumVioletRed,
bounds: const Rect.fromLTWH(170, 100, 0, 0));
-//Save and close the PDF document
+//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
@@ -92,13 +92,13 @@ You can also change the [`orientation`](https://pub.dev/documentation/syncfusion
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Set the page size
document.pageSettings.size = PdfPageSize.a4;
-//Change the page orientation to 90 degree
+//Change the page orientation to 90 degrees
document.pageSettings.rotate = PdfPageRotateAngle.rotateAngle90;
//Draw the text by adding page to the document
@@ -107,10 +107,10 @@ document.pages.add().graphics.drawString(
brush: PdfBrushes.mediumVioletRed,
bounds: const Rect.fromLTWH(170, 100, 0, 0));
-//Save and close the PDF document
+//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
@@ -121,22 +121,22 @@ PDF [`sections`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Add a section to PDF document
PdfSection section = document.sections!.add();
-//Draw the text by section page graphics
+//Draw the text on the section page graphics
section.pages.add().graphics.drawString(
'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27),
brush: PdfBrushes.mediumVioletRed,
bounds: const Rect.fromLTWH(170, 100, 0, 0));
-//Save and close the PDF document
+//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
@@ -157,11 +157,11 @@ document.fileStructure.incrementalUpdate = false;
//Set the compression level
document.compressionLevel = PdfCompressionLevel.best;
-//Saves the document
+//Save the document
File('output.pdf').writeAsBytes(await document.save());
-//Disposes the document
+//Dispose the document
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md
index b3f0ef4625..07b61f0d53 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md
@@ -1,7 +1,7 @@
---
layout: post
title: Flow layout in Flutter PDF library | Syncfusion
-description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library and more.
+description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library.
platform: document-processing
control: PDF
documentation: ug
@@ -9,7 +9,7 @@ documentation: ug
# Flow layout in Flutter PDF
-The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of previously drawn element.
+The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of the previously drawn elements.
## Flow model using PdfLayoutResult
@@ -42,7 +42,7 @@ PdfLayoutResult layoutResult = textElement.draw(
page.getClientSize().height))!;
//Assign header text to PdfTextElement
-textElement.text = 'Top 5 sales stores';
+textElement.text = 'Top 3 sales stores';
//Assign standard font to PdfTextElement
textElement.font = PdfStandardFont(PdfFontFamily.helvetica, 14,
@@ -70,7 +70,7 @@ row2.cells[0].value = 'E02';
row2.cells[1].value = 'Thomas';
row2.cells[2].value = '\$10,500';
PdfGridRow row3 = grid.rows.add();
-row3.cells[0].value = 'E02';
+row3.cells[0].value = 'E03';
row3.cells[1].value = 'Simon';
row3.cells[2].value = '\$12,000';
@@ -86,4 +86,4 @@ File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md
index 8b85ad5e7e..640eb56d39 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md
@@ -9,7 +9,7 @@ documentation: UG
# Forms in Flutter PDF
-An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all that makes a single, globally interactive form spanning the entire document.
+An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all of which makes a single, globally interactive form spanning the entire document.
## Creating a new PDF form
@@ -299,7 +299,7 @@ File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
-### Adding the check Box field
+### Adding the check box field
You can create the check box field in PDF forms using the PdfCheckBoxField class.
@@ -340,7 +340,7 @@ final PdfDocument document =
// Create a check box form field and add it to the existing document.
document.form.fields.add(PdfCheckBoxField(
- document.pages.add(), 'CheckBox', Rect.fromLTWH(100, 200, 70, 45),
+ document.pages[0], 'CheckBox', Rect.fromLTWH(100, 200, 70, 45),
highlightMode: PdfHighlightMode.push,
borderStyle: PdfBorderStyle.dot,
borderColor: PdfColor(230, 0, 172),
@@ -373,7 +373,7 @@ document.form.fields.add(PdfSignatureField(document.pages.add(), 'Sign',
bounds: Rect.fromLTWH(100, 100, 100, 50)));
//Save the PDF document.
-File('output.pdf').writeAsBytesSync(document.save());
+File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
@@ -456,9 +456,9 @@ File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
-## Set appearance to the PDF form fields
+## Setting appearance to the PDF form fields
-After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to false, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers.
+After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to true, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers.
The following code sample explains how to set appearance to the PDF form fields.
@@ -511,7 +511,7 @@ File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
-Retrieving or Modifying the fore, border, and back color of an existing form field
+### Retrieving or modifying the fore, border, and back color of an existing form field
You can retrieve or modify the fore, border, and background color of existing form fields in a PDF document by using the foreColor, borderColor, and backColor properties of the respective form fields. The following code sample explains this.
@@ -653,7 +653,7 @@ File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
-### Enumerate the form fields
+### Enumerating the form fields
All the form fields are maintained in the PdfFormFieldCollection class. You can enumerate the fields from this form field collection and fill them.
@@ -703,7 +703,7 @@ document.form.fields.add(PdfTextBoxField(
text: 'toType', isPassword: true, spellCheck: true));
//Save the PDF document.
-File('output.pdf').writeAsBytesSync(document.save());
+File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
@@ -748,7 +748,7 @@ document.form.fields.add(PdfTextBoxField(
text: 'toType', isPassword: true, spellCheck: true));
//Save the PDF document.
-File('output.pdf').writeAsBytesSync(document.save());
+File('output.pdf').writeAsBytesSync(await document.save());
{% endhighlight %}
{% endtabs %}
@@ -801,9 +801,9 @@ File('output.pdf').writeAsBytesSync(await document.save());
Flutter PDF supports auto naming of form fields in a PDF document while creating form fields with the same name. The fieldAutoNaming property of PdfForm is used to enable or disable auto naming of a form field.
-While enabling this property, the field names are auto naming. If the fields are created using the same or common name, the created fields will act as an individual.
+While enabling this property, the field names are auto-named. If the fields are created using the same or common name, the created fields will act as an individual.
-While disabling this property, the field names are not auto naming, and the created fields are saved in a single group. The same value will be referred in all the same name fields.
+While disabling this property, the field names are not auto-named, and the created fields are saved in a single group. The same value will be referred in all the same name fields.
By default, the value is set to true. This is explained in the following code sample.
@@ -935,7 +935,7 @@ File('output.pdf').writeAsBytesSync(await document.save());
## Importing XML file to PDF
-XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the JSON file to PDF using the importData method available in the ['PdfForm'](#) class.
+XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the XML file to PDF using the importData method available in the ['PdfForm'](#) class.
The following code sample explains how to import XML files to PDF.
@@ -1044,7 +1044,7 @@ document.dispose();
Sometimes, Form fields may appear empty in an adobe reader due to the absence of the appearance dictionary. To resolve this, you need to enable the Adobe Reader default appearance by using the setDefaultAppearance method in PdfForm class.
-The following code explains how to enable the default appearance in a new PDF document.
+The following code explains how to enable the default appearance in an existing PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md
index 90714757fb..78d4d7bfb0 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md
@@ -1,7 +1,7 @@
---
layout: post
title: Headers and Footers in Flutter PDF library | Syncfusion
-description: Learn here all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -9,13 +9,13 @@ documentation: ug
# Headers and Footers in Flutter PDF
-The Flutter PDF supports drawing the header and footer in PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer contain the graphics support and automatic field support to perform their operations.
+The Flutter PDF supports drawing the header and footer in a PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer support graphics and automatic fields to perform various operations.
-## Adding graphics and automatic fields to header and footer
+## Adding graphics and automatic fields to the header and footer
-This package supports to add page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more.
+This package supports adding page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more.
-The following code snippet explains how to use the graphics and automatic fields in header and footer.
+The following code snippet explains how to use the graphics and automatic fields in the header and footer.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -34,7 +34,7 @@ PdfDateTimeField dateAndTimeField = PdfDateTimeField(
dateAndTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13);
dateAndTimeField.dateFormatString = 'E, MM.dd.yyyy';
-//Create the composite field with date field
+//Create the composite field with a date field
PdfCompositeField compositefields = PdfCompositeField(
font: PdfStandardFont(PdfFontFamily.timesRoman, 19),
brush: PdfSolidBrush(PdfColor(0, 0, 0)),
@@ -65,7 +65,7 @@ PdfPageCountField count = PdfPageCountField(
font: PdfStandardFont(PdfFontFamily.timesRoman, 19),
brush: PdfSolidBrush(PdfColor(0, 0, 0)));
-//set the number style for page count
+//Set the number style for page count
count.numberStyle = PdfNumberStyle.upperRoman;
//Create the date and time field
@@ -79,7 +79,7 @@ dateTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13);
//Sets the date and time format
dateTimeField.dateFormatString = 'hh\':\'mm\':\'ss';
-//Create the composite field with page number page count
+//Create the composite field with page number and page count
PdfCompositeField compositeField = PdfCompositeField(
font: PdfStandardFont(PdfFontFamily.timesRoman, 19),
brush: PdfSolidBrush(PdfColor(0, 0, 0)),
@@ -110,6 +110,6 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-By executing the above code sample, you will get the PDF document as follows.
+By executing the above code sample, you will get the PDF document as shown below.
-
+
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md
index 5b64a116e5..fb7a1712e0 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md
@@ -9,7 +9,7 @@ documentation: ug
# Hyperlinks in Flutter PDF
-In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file and web page.
+In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file or a web page.
## Working with Web navigation
@@ -25,7 +25,7 @@ PdfDocument document = PdfDocument();
//Create and draw the web link in the PDF page
PdfTextWebLink(
- url: 'www.google.co.in',
+ url: 'https://www.google.co.in',
text: 'google',
font: PdfStandardFont(PdfFontFamily.timesRoman, 14),
brush: PdfSolidBrush(PdfColor(0, 0, 0)),
@@ -46,7 +46,7 @@ document.dispose();
## Working with internal document navigation
-To allow the users navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used.
+To allow users to navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used.
The following code explains how to add the hyperlink for internal document navigation.
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md
index 97f8b6ef45..5addbd8cbf 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md
@@ -1,7 +1,7 @@
---
layout: post
title: Images in Flutter PDF library | Syncfusion
-description: Learn here all about draw raster images and applying transparency and rotation to the images feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn how to draw raster images and apply transparency and rotation using the Syncfusion Flutter PDF non-UI library.
platform: document-processing
control: PDF
documentation: ug
@@ -9,9 +9,9 @@ documentation: ug
# Images in Flutter PDF
-Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class.
+Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for the [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class.
-## Inserting an image in PDF document
+## Inserting an image in a PDF document
The following raster images are supported in Flutter PDF:
@@ -62,7 +62,7 @@ PdfPage page = document.pages.add();
//Save the current graphics state
PdfGraphicsState state = page.graphics.save();
-//Translate the coordinate system to the required position
+//Translate the coordinate system to the required position
page.graphics.translateTransform(20, 100);
//Apply transparency
@@ -89,9 +89,9 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Inserting image to PDF using a web URL
+## Inserting an image to a PDF using a web URL
-The ['PdfBitmap'](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts List and base64 string as inputs, so you can retrieve the image from the web URL as base64 or List and assign it to the bitmap class.
+The [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts `List` and base64 string as inputs, so you can retrieve the image from the web URL as `List` (or base64) and assign it to the bitmap class.
Steps to insert an image to the PDF using Web URL:
1. Add **http** package to the dependencies section of the **pubspec.yaml** file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md
index 387bd5aff8..65f1fa6626 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md
@@ -65,7 +65,7 @@ File('output.pdf').writeAsBytes(await document.save());
{% endhighlight %}
{% endtabs %}
-The following code shows how to add the multiple layers in an existing PDF document.
+The following code shows how to add a layer to an existing PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -101,7 +101,7 @@ File('output.pdf').writeAsBytes(await document.save());
## Toggling the visibility of layers
-The visibility of a layer can be mentioned while creating a new page layer.
+The visibility of a layer can be specified while creating a new page layer.
The following code shows how to toggle the visibility of layers in a new PDF document.
@@ -136,7 +136,7 @@ File('output.pdf').writeAsBytes(await document.save());
## Removing layers from an existing PDF document
-You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is showed in the following code sample.
+You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is shown in the following code sample.
{% tabs %}
{% highlight dart tabtitle="dart" %}
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md
index 62c9110dd0..da041ca826 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md
@@ -1,7 +1,7 @@
---
layout: post
title: Bullets and Lists in Flutter PDF library | Syncfusion
-description: Learn here all about add ordered and unordered lists feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn here all about adding ordered and unordered lists features of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -9,7 +9,7 @@ documentation: ug
# Bullets and Lists in Flutter PDF
-The Syncfusion® Flutter PDF allows you list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images.
+The Syncfusion® Flutter PDF allows you to list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images.
## Adding an ordered list
@@ -76,7 +76,7 @@ document.dispose();
## Adding a sub list
-The Syncfusion® Flutter PDF also provides support to create a sub list to a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same.
+The Syncfusion® Flutter PDF also provides support to create a sub list in a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same.
{% tabs %}
{% highlight dart tabtitle="dart" %}
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md
index deaba3983a..56df6dd059 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md
@@ -1,7 +1,7 @@
---
layout: post
title: Pages in Flutter PDF library | Syncfusion
-description: Learn here all about add, rotate pages and customize page settings feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn about adding and rotating pages and customizing page settings in the Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -16,7 +16,7 @@ The following code sample explains how to add a [`PdfPage`](https://pub.dev/docu
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Create a new PDF page and draw the text
@@ -46,7 +46,7 @@ PdfDocument document =
document.pages.insert(0);
//Saves the document
-File('output.pdf').writeAsBytes(await document.save());
+File('Output.pdf').writeAsBytes(await document.save());
//Disposes the document
document.dispose();
@@ -62,7 +62,7 @@ You can add [`margin`](https://pub.dev/documentation/syncfusion_flutter_pdf/late
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Set margin for all the pages
@@ -71,10 +71,11 @@ document.pageSettings.margins.all = 200;
//Draw the text by adding page to the document
document.pages.add().graphics.drawString(
'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27),
- brush: PdfBrushes.darkBlue);
+ brush: PdfBrushes.darkBlue, bounds: const Rect.fromLTWH(170, 100, 0, 0));
//Save and dispose the PDF document
-List bytes =await document.save();
+List bytes = await document.save();
+await File('Output.pdf').writeAsBytes(bytes);
document.dispose();
{% endhighlight %}
@@ -150,7 +151,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Get the number of pages from a PDF document
+## Getting the number of pages from a PDF document
You can get the page count from the existing PDF document as shown in the following code sample.
@@ -232,7 +233,7 @@ document.pages.remove(page);
document.pages.removeAt(0);
//Saves the document
-File('output.pdf').writeAsBytes(await document.save());
+File('Output.pdf').writeAsBytes(await document.save());
//Disposes the document
document.dispose();
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md
index 71e9d5d5ff..061ae4ef7f 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md
@@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF currently supports the following PDF
* PDF/A-2b conformance
* PDF/A-3b conformance
-N> To know more details about PDF/A standard refer [`https://en.wikipedia.org/wiki/PDF/A#Description`](https://en.wikipedia.org/wiki/PDF/A#Description)
+N> To know more details about the PDF/A standard, refer to [PDF/A standard](https://en.wikipedia.org/wiki/PDF/A#Description)
## PDF/A-1b conformance
@@ -63,7 +63,7 @@ document.dispose();
## PDF/A-3b conformance
-The PDF/A-3b conformance supports the external files as attachment to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files.
+The PDF/A-3b conformance supports external files as attachments to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files.
You can create a PDF/A-3b document by specifying the conformance level as a3b through PdfConformanceLevel enum when creating the new PDF document as follows.
@@ -79,7 +79,7 @@ PdfDocument document = PdfDocument(conformanceLevel: PdfConformanceLevel.a3b)
//Creates an attachment
PdfAttachment attachment = PdfAttachment(
'input.txt', File('input.txt').readAsBytesSync(),
- description: 'Input text', mimeType: 'application/txt')
+ description: 'Input text', mimeType: 'text/plain')
..relationship = PdfAttachmentRelationship.alternative
..modificationDate = DateTime.now();
@@ -93,4 +93,4 @@ File('output.pdf').writeAsBytes(await document.save());
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md
index a8115e6f8e..e553fd141b 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md
@@ -1,7 +1,7 @@
---
layout: post
title: Templates in Flutter PDF library | Syncfusion
-description: Learn here all about add headers and footers and stamp by Templates feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn here all about adding headers, footers, and stamps using the Templates feature of the Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -9,11 +9,11 @@ documentation: ug
# Templates in Flutter PDF
-A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) is supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page.
+A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) are supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page.
## Creating a new PDF template
-The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object.
+The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object.
The following code example explains how to add contents to the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) and render into the new PDF page.
@@ -49,7 +49,7 @@ document.dispose();
Essential® PDF supports template creation using the [`CreateTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/createTemplate.html) method, enabling users to extract content from an existing PDF page and seamlessly incorporate it into a new PDF document.
-The below code illustrates how to create the template from an existing page and draw it in a new PDF document.
+The following code illustrates how to create the template from an existing page and draw it in a new PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -69,6 +69,8 @@ The below code illustrates how to create the template from an existing page and
PdfGraphics graphics = page.graphics;
//Draw the template.
graphics.drawPdfTemplate(template, Offset(0, 0));
+ //Dispose the loaded PDF document.
+ loadedDocument.dispose();
//Save and dispose of the PDF document.
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();
@@ -185,7 +187,7 @@ document.dispose();
## Adding stamp to the PDF document
-The Syncfusion® Flutter PDF allows you add stamp to the PDF document using PDF templates.
+The Syncfusion® Flutter PDF allows you to add a stamp to the PDF document using PDF templates.
The following code example explains how to draw text as a stamp to the PDF document.
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md
index 1511700976..30b379cd7d 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md
@@ -9,7 +9,7 @@ documentation: ug
# Security in Flutter PDF
-Flutter PDF allows you to protect the PDF document using encryption and set permission to the PDF document operations like printing, editing, copy content etc. using user password and owner password. Two types of encryption algorithms are available
+Flutter PDF allows you to protect the PDF document using encryption and set permissions for PDF document operations like printing, editing, copying content, and more using user password and owner password. Two types of encryption algorithms are available
* Rivest Cipher 4 (RC4)
* Advanced Encryption Standard (AES)
@@ -23,7 +23,7 @@ User password: Prevents people from opening or viewing a PDF document. Once the
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Document security
@@ -48,16 +48,16 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-N> While using both user and owner passwords, please specify different user and owner password while encrypting the PDF document for better security.
+N> When using both user and owner passwords, please specify a different password for each while encrypting the PDF document for better security.
You can protect the PDF document from printing, editing, copying with the [`ownerPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/ownerPassword.html) by using the following code snippet.
-Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. It further secures the PDF document to set a PDF Owner Password.
+Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. Setting a PDF owner password further secures the PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Document security
@@ -91,12 +91,12 @@ document.dispose();
## Working with AES Encryption
-You can encrypt PDF document using AES algorithm with 128bit or 256bit or 256bit Revision 6 key size. The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html).
+You can encrypt PDF document using AES algorithm with 128bit, 256bit, or 256bit Revision 6 key size by setting the [`algorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/algorithm.html) to the corresponding [`PdfEncryptionAlgorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfEncryptionAlgorithm.html) value (`aesx128Bit`, `aesx256Bit`, or `aesx256BitRevision6`). The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html).
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Document security
@@ -185,9 +185,9 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Changing the password of the PDF document
+## Changing the user password of the PDF document
-You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using following code snippet.
+You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using the following code snippet.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -206,7 +206,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Remove password from the user password PDF document
+## Remove the user password from a PDF document
You can remove the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) from the encrypted PDF document by using the following code snippet.
@@ -259,9 +259,9 @@ document.dispose();
## How to determine whether the PDF document is protected by user or owner password?
-Flutter PDF supports identifying the document whether it is protected by user or owner.
+Flutter PDF supports identifying whether a document is protected by a user or owner password.
-The following table shows the various combination for loading the secured document with user or owner password:
+The following table shows the various combinations for loading a secured document with a user or owner password:
@@ -338,4 +338,4 @@ Returns owner Password (owner password is same as the user password; it allows f
-
+
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md
index 900fd82860..fd3d4f55c5 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md
@@ -180,7 +180,7 @@ document.dispose();
### Arc
-You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document.
+You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics/drawArc.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -248,4 +248,4 @@ File('Ellipse.pdf').writeAsBytes(await document.save());
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md
index 0db94dc49a..4db03b733b 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md
@@ -1,7 +1,7 @@
---
layout: post
title: Tables in Flutter PDF library | Syncfusion
-description: Learn here all about draw and customize cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn here all about drawing and customizing cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for creating customi
## Creating a table
-[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create table by entering the data manually.
+[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create a table by entering the data manually.
The following code example explains how to create a table directly using [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) with [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html), [`PdfGridColumn`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridColumn-class.html) and [`PdfGridRow`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridRow-class.html) classes.
@@ -29,10 +29,10 @@ PdfGrid grid = PdfGrid();
//Add the columns to the grid
grid.columns.add(count: 3);
-//Add header to the grid
+//Add a header to the grid
grid.headers.add(1);
-//Add the rows to the grid
+//Add the header to the grid
PdfGridRow header = grid.headers[0];
header.cells[0].value = 'Employee ID';
header.cells[1].value = 'Employee Name';
@@ -263,7 +263,7 @@ document.dispose();
## Table customization in PdfGrid
-Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverLapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class.
+Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverlapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class.
The following code snippet explains how to customize the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html).
@@ -356,14 +356,14 @@ document.dispose();
## Pagination in PdfGrid
-Flutter PDF supports to paginate the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class.
+Flutter PDF supports paginating the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class.
The following sample explains how to allow [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) to flow across pages.
{% tabs %}
{% highlight dart tabtitle="dart" %}
-//Create a new PDF documentation
+//Create a new PDF document
PdfDocument document = PdfDocument();
//Create a PdfGrid
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md
index 8f7c0c0878..1ef5c03abd 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md
@@ -1,7 +1,7 @@
---
layout: post
title: Text extraction in Flutter PDF library | Syncfusion
-description: Learn here all about different types of fonts and draw Text feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn how to extract or find text from PDF pages using the Syncfusion Flutter PDF library with simple, practical code examples and more.
platform: document-processing
control: PDF
documentation: ug
@@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF allows you to extract or find the tex
You can extract the text from pages using the extractText method in the PdfTextExtractor class.
-The following code explains how to extract the text from the entire PDF document:
+The following code sample explains how to extract the text from the entire PDF document:
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -33,7 +33,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-The following code sample explains how to extract the texts from a specific page:
+The following code sample explains how to extract the text from a specific page:
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -51,7 +51,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-The following code sample explains how to extract the texts from a particular page range:
+The following code sample explains how to extract the text from a particular page range:
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -114,7 +114,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-### Working with words
+### Working with Words
You can get a single word and its properties by using the TextWord. Refer to the following code sample.
@@ -162,7 +162,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-### Working with characters
+### Working with Characters
You can get a single character and its properties by using the TextGlyph. Refer to the following code sample.
@@ -213,7 +213,7 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-## Working with find text
+## Working with Find Text
You can find a collection of text from pages using the findText method in the PdfTextExtractor class. You can get the text and its properties using the MatchedItem.
@@ -287,4 +287,4 @@ List textCollection = PdfTextExtractor(document).findText(
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md
index 768dd4de82..51bfb5777e 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md
@@ -1,7 +1,7 @@
---
layout: post
title: Text drawing in Flutter PDF library | Syncfusion
-description: Learn here all about Text extraction and find text feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn all about the text drawing feature of the Syncfusion Flutter PDF non-UI library with simple, practical code examples and more.
platform: document-processing
control: PDF
documentation: ug
@@ -71,9 +71,9 @@ The Syncfusion® Flutter PDF allows you to add text to the PDF doc
### Draw text using standard fonts
-PDF has fourteen base fonts also known as standard fonts, which has special significance. The details can be referred from the link below.
+PDF has fourteen base fonts also known as standard fonts, which have special significance. The details can be referred from the link below.
-[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_.28Standard_14_Fonts.29)
+[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_(Standard_14_Fonts))
You can add text using the standard PDF fonts, by initializing the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfStandardFont-class.html) class. The following code snippet explains this.
@@ -99,7 +99,7 @@ document.dispose();
### Draw text using TrueType fonts
-You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or base64 string format. The following code snippet explains this.
+You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or in base64 string format. The following code snippet explains this.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -123,7 +123,7 @@ document.dispose();
### Draw text using CJK fonts
-The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as PDF CJK StandardFont. The following code sample explains this.
+The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfCjkStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfCjkStandardFont-class.html). The following code sample explains this.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -147,7 +147,7 @@ document.dispose();
## Measuring a string
-The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method of it and returns the size. Refer to the following code sample.
+The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method and returns the size. Refer to the following code sample.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -215,7 +215,7 @@ document.dispose();
## Creating a multicolumn PDF document
-Syncfusion® Flutter PDF allows you to create a multi-column text in PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains the same.
+Syncfusion® Flutter PDF allows you to create a multi-column text in a PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains how to draw text in multiple columns.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -300,13 +300,13 @@ File('Output.pdf').writeAsBytes(await document.save());
//Disposes the document
document.dispose();
-
+
{% endhighlight %}
{% endtabs %}
-## Draw text with Pens and Brushes
+## Drawing text with pens and brushes
-Pens and brushes are used to draw the content on PDF document with specific color and style.
+Pens and brushes are used to draw the content on a PDF document with specific color and style.
{% tabs %}
{% highlight dart tabtitle="dart" %}
@@ -318,11 +318,11 @@ final PdfDocument document = PdfDocument();
document.pages.add().graphics.drawString(
'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 20),
brush: PdfSolidBrush(PdfColor(0, 0, 0)),
- pen: PdfPen(PdfColor(255, 0, 0), width : 0.5),
+ pen: PdfPen(PdfColor(255, 0, 0), width: 0.5),
bounds: const Rect.fromLTWH(0, 0, 500, 50));
//Save the document
-final List bytes =await document.save();
+File('Output.pdf').writeAsBytes(await document.save());
//Dispose the document
document.dispose();
@@ -330,4 +330,4 @@ document.dispose();
{% endhighlight %}
{% endtabs %}
-The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on PDF document.
\ No newline at end of file
+The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on a PDF document.
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md
index aea556cd11..c647e4b57e 100644
--- a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md
+++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md
@@ -1,7 +1,7 @@
---
layout: post
title: Watermarks in Flutter PDF library | Syncfusion
-description: Learn here all about add text and image Watermarks feature of Syncfusion Flutter PDF non-UI library and more.
+description: Learn all about adding text and image watermarks feature of Syncfusion Flutter PDF non-UI library and more.
platform: document-processing
control: PDF
documentation: ug
@@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for adding watermark
## Adding text watermark to a PDF document
-The Syncfusion® Flutter PDF allows you draw the text watermark to the PDF document using graphics elements.
+The Syncfusion® Flutter PDF allows you to draw the text watermark to the PDF document using graphics elements.
The following code example explains how to draw the text watermark to the PDF document.
@@ -85,4 +85,4 @@ File('SampleOutput.pdf').writeAsBytes(await document.save());
document.dispose();
{% endhighlight %}
-{% endtabs %}
+{% endtabs %}
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-angular.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-angular.md
index 96de970ec8..91e287afb9 100644
--- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-angular.md
+++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-angular.md
@@ -1,73 +1,120 @@
---
layout: post
-title: Create or Generate PDF file in Angular | Syncfusion
-description: Learn how to create a PDF file in Angular with easy steps using JavaScript PDF Library without depending on Adobe
+title: Create or Generate a PDF File in an Angular Application | Syncfusion
+description: Learn how to create a PDF file in an Angular application with easy steps using the JavaScript PDF Library without depending on Adobe.
platform: document-processing
control: PDF
documentation: ug
-keywords: angular create pdf, angular generate pdf, angular pdf library, ej2 pdf angular, JavaScript
+keywords: angular create pdf, angular generate pdf, angular pdf library, ej2 pdf angular, javascript
+canonical_url: https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-angular
---
-# Create or Generate PDF file in Angular application
+# Create or Generate a PDF File in an Angular Application
-The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill forms, and secure PDF files.
+The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill PDF forms, and secure PDF files.
-This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an Angular application.
+This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an Angular application that runs in the browser. The generated PDF is downloaded directly from the browser; no server-side PDF rendering is involved.
-## Setup Angular Environment
+## Prerequisites
-You can use the [Angular CLI](https://github.com/angular/angular-cli) to setup your Angular applications.
-To install the latest Angular CLI globally use the following command.
+Before you begin, make sure you have the following installed:
+
+- Angular 20 or later.
+- Node.js 18 or later.
+- npm 9 or later, or Yarn 1.22 or later.
+- Visual Studio Code or another code editor.
+- A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox.
+
+To verify your Node.js and npm versions, run the following commands:
```bash
-npm install -g @angular/cli
+node --version
+npm --version
```
-N> To install a specific Angular CLI version, use: **npm install --save @angular/cli@12.0.2**
+## Project Setup
+
+This guide includes all the steps needed to create and run the sample in an Angular application. You can either create a new project or use an existing one.
+
+### Option A: Create a New Angular Project
+
+If you do not have an Angular project, create one by using the Angular CLI:
+
+```bash
+npm install -g @angular/cli
+ng new my-pdf-app
+cd my-pdf-app
+```
-## Create an Angular Application
+### Option B: Use an Existing Angular Project
-Start a new Angular application using the Angular CLI command as follows.
+If you already have an Angular project, open its root folder and continue with the package installation steps:
```bash
-ng new my-app
-cd my-app
+cd path/to/your-existing-app
```
-## Installing JavaScript PDF package
+## Installing the JavaScript PDF Library package
-All Syncfusion® JS 2 packages are published in `npmjs.com` registry.
+All Syncfusion® JS 2 packages are published in `npmjs.com` registry. The `npm install` command below resolves `@syncfusion/ej2-pdf` to the latest stable version that is compatible with Angular 20 or later.
-* To install PDF component, use the following command.
+* To install the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library), use the following command.
```bash
npm install @syncfusion/ej2-pdf --save
```
-N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
-* Copy the `ej2-pdf-lib` folder from the @syncfusion/ej2-pdf-data-extract package into your project's **public, dist, or assets** directory (where your static files are served).
-* Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files.
-* Ensure your server serves .wasm files with the **Content-Type: application/wasm** MIME type.
-(Angular’s development server already handles this; configure production servers manually.)
-* This setup is not required for **basic PDF creation**.
-## Create a PDF document
+* If you prefer Yarn, use the following command.
+
+```bash
+yarn add @syncfusion/ej2-pdf
+```
+
+N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. Note the following:
+- Copy the `ej2-pdf-lib` folder from the `@syncfusion/ej2-pdf-data-extract` package into your project's **public**, **dist**, or **assets** directory (wherever your static files are served).
+- Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files.
+- Ensure your server serves `.wasm` files with the **Content-Type: application/wasm** MIME type. Angular's development server already handles this; configure production servers manually.
+- This setup is not required for **basic PDF creation**.
+
+## Add the Syncfusion License Key
+
+If your project requires a Syncfusion license, register the license key before using the PDF API. Add the license registration code in your startup file, such as `main.ts`.
-* Add a simple button to `app.component.html` and attach a click handler that uses the TypeScript PDF API to create a new PDF document.
+```ts
+import { registerLicense } from '@syncfusion/ej2-base';
+
+registerLicense('YOUR_LICENSE_KEY');
+```
+
+Replace `YOUR_LICENSE_KEY` with the key from your Syncfusion account. For more information, see the [Syncfusion licensing documentation](https://help.syncfusion.com/document-processing/licensing/overview).
+
+## Browser and Environment Compatibility
+
+| Environment | Supported version |
+| --- | --- |
+| Angular | 20 or later |
+| Node.js | 18.x or later |
+| TypeScript | Installed with Angular |
+| Visual Studio Code | Latest version recommended |
+| Chrome | Latest two major versions |
+| Edge | Latest two major versions |
+| Firefox | Latest two major versions |
+
+> For server-side rendering or Angular Universal, create the PDF document only in browser execution paths. The sample in this guide uses a click handler that runs in the browser, so no additional lifecycle handling is required.
+
+## Create a PDF Document
+
+Add a button to the Angular template and attach a click handler that uses the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) to create a new PDF document.
+
+* Add the following button to `app.component.html`.
{% tabs %}
{% highlight html tabtitle="app.component.html" %}
-
-
- PDF creation example
-
-
-
-
-
+
{% endhighlight %}
{% endtabs %}
-* Include the following namespaces in `app.component.ts` file.
+* Include the following namespaces in `app.component.ts`.
{% tabs %}
{% highlight ts tabtitle="~/app.component.ts" %}
@@ -75,7 +122,7 @@ import { PdfDocument, PdfGraphics, PdfPage, PdfFontFamily, PdfFontStyle, PdfFont
{% endhighlight %}
{% endtabs %}
-* Include the following code example in the click event of the button in `app.component.ts` to generate a PDF document.
+* Include the following code in the click event of the button in `app.component.ts` to generate a PDF document.
{% tabs %}
{% highlight ts tabtitle="app.component.ts" %}
@@ -100,14 +147,44 @@ document.getElementById('normalButton').onclick = (): void => {
{% endhighlight %}
{% endtabs %}
-## Run the application
+## Code Explanation
+
+- `PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object.
+- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`.
+- `save('Output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder.
+- `destroy()` — releases native resources held by the document.
-Use the following command to run the application in browser.
+## Run the Application
+
+Use the following command to run the application in the browser:
```bash
ng serve --open
```
-By executing the program, you will get the PDF document as follows.
+When you click **Create PDF document**, the PDF file is generated in the browser and downloaded as `Output.pdf` to your default downloads folder.
+
+
+
+## Troubleshooting
+
+| Problem | Cause | Resolution |
+|---|---|---|
+| `TS2304: Cannot find name 'PdfDocument'` (or similar) | The import line is missing or the package is not installed | Confirm `npm install @syncfusion/ej2-pdf` ran successfully and that the import is in `app.component.ts` |
+| `Error: Cannot find module '@syncfusion/ej2-pdf'` | The package is not installed | Run `npm install @syncfusion/ej2-pdf --save` |
+| Button click does nothing | The button ID does not match the ID used in `getElementById` | Confirm the button's `id` is `normalButton` |
+| PDF file does not download | The browser blocks the download | Check the browser's download settings and the downloads folder |
+| Build fails with TypeScript errors | The Angular TypeScript version is incompatible with the PDF package | Update Angular to 20 or later and run `npm install` again |
+| `registerLicense` warning at runtime | The license key is missing or invalid | Confirm the key is set in `main.ts` and is the correct key for your Syncfusion account |
+
+## Additional Resources
-
\ No newline at end of file
+- [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library)
+- [JavaScript PDF Library documentation](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/overview)
+- [JavaScript PDF Library API reference](https://ej2.syncfusion.com/documentation/api/pdf)
+- [JavaScript PDF Library examples](https://document.syncfusion.com/demos/pdf/angular/#/fluent2/pdf/default)
+- [Syncfusion licensing documentation](https://help.syncfusion.com/document-processing/licensing/overview)
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md
index 211af02fc7..5aab62cabb 100644
--- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md
+++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md
@@ -1,30 +1,52 @@
---
layout: post
-title: Create or Generate PDF in ASP.NET Core | Syncfusion
-description: Learn how to create or generate a PDF file in ASP.NET Core applications with easy steps using JavaScript PDF Library without depending on Adobe.
+title: Create or Generate a PDF in ASP.NET Core | Syncfusion
+description: Learn how to create or generate a PDF file in an ASP.NET Core application with easy steps using the JavaScript PDF Library without depending on Adobe.
platform: document-processing
control: PDF
documentation: ug
keywords: .net core create pdf, edit pdf, merge, pdf form, fill form, digital sign, table, javascript, dotnet core pdf, asp generate pdf, aspx generate pdf
+canonical_url: https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-asp-net-core
---
-# Create or Generate PDF in ASP.NET Core
+# Create or Generate a PDF in ASP.NET Core
The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill forms, and secure PDF files.
-This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an ASP.NET Core application.
+This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an ASP.NET Core application. The PDF is generated **client-side in the browser** using the Syncfusion JavaScript PDF Library loaded from a CDN; ASP.NET Core is used to host the page that triggers the download.
+
+## Prerequisites
+
+Before you begin, make sure you have the following installed:
+
+- Visual Studio 2022 (any edition) with the **ASP.NET and web development** workload.
+- .NET SDK 8.0 (LTS) or later.
+- An active internet connection (the sample loads the JavaScript PDF Library from the Syncfusion CDN).
+- A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox.
+
+To verify your .NET SDK version, run:
+
+```bash
+dotnet --version
+```
## Integrate the PDF Library into an ASP.NET Core application
Step 1: Start Visual Studio and select **Create a new project**.
+
Step 2: In the **Create a new project** dialog, select **ASP.NET Core Web App**.
+

+
Step 3: In the **Configure your new project** dialog, enter the project name and select **Next**.
+

-Step 4: In the **Additional information** dialog, select a .NET LTS version (for example, **.NET 8.0 (Long-term Support)**) and then select **Create**.
+
+Step 4: In the **Additional information** dialog, select a .NET LTS version (for example, **.NET 8.0 (Long-term support)**) and then select **Create**.
+

-Step 5: **Add script reference**: Add the required scripts using the CDN inside the `` of `~/Views/Shared/_Layout.cshtml` as follows:
+Step 5: Add the script reference: open `~/Views/Shared/_Layout.cshtml` and add the Syncfusion CDN reference inside the `` element. Also confirm that the layout contains `@await RenderSectionAsync("Scripts", required: false)` so the `@section Scripts` block in Step 6 can render.
{% tabs %}
{% highlight cshtml tabtitle="~/_Layout.cshtml" %}
@@ -32,17 +54,19 @@ Step 5: **Add script reference**: Add the required scripts using the CDN inside
+
+ @RenderBody()
+ @await RenderSectionAsync("Scripts", required: false)
+
{% endhighlight %}
{% endtabs %}
N> Check out the following topics for including script references in an ASP.NET Core application to enable PDF creation using the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library):
-* [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference)
-* [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm)
-* [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)
-For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
-Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction.
+- [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference)
+- [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm)
+- [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)
-Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
+Step 6: Create a PDF document: open `~/Views/Home/Index.cshtml` and add a button plus a click handler that uses the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) to generate a PDF in the browser.
{% tabs %}
{% highlight cshtml tabtitle="~/Views/Home/Index.cshtml" %}
@@ -54,32 +78,70 @@ Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml`
@section Scripts {
}
{% endhighlight %}
{% endtabs %}
-step 7: **Build the project**: Click on Build > Build Solution or press Ctrl + Shift + B to build the project.
+## Code Explanation
+
+- `ej.pdf.PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object.
+- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`.
+- `graphics.clientSize.width` — the writable width of the page in points.
+- `save('output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server.
+- `destroy()` — releases native resources held by the document.
+
+## Build and Run the Application
+
+Step 7: Build the project: click **Build** > **Build Solution** or press **Ctrl + Shift + B** to build the project.
+
+Step 8: Run the project: click the **Start** button (green arrow) or press **F5** to run the app. Visual Studio launches the app in your default browser.
+
+After running the application, click **Generate PDF document**. The browser downloads `output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left.
+
+
+
+## Additional Configuration
+
+N> For image and data extraction features, install the `@syncfusion/ej2-pdf-data-extract` package as an add-on (NPM approach), then copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into a publicly accessible location under `wwwroot/` (for example, `wwwroot/lib/ej2-pdf-lib/`). The folder must contain the required `.js` and `.wasm` files. This setup is not required for **basic PDF creation** as shown in this guide.
+
+## Troubleshooting
-Step 8: **Run the project**: Click the Start button (green arrow) or press F5 to run the app.
+| Problem | Cause | Resolution |
+|---|---|---|
+| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the `
+
+ @RenderBody()
+ @await RenderSectionAsync("Scripts", required: false)
+
{% endhighlight %}
{% endtabs %}
N> Check out the following topics for including script references in an ASP.NET MVC application to enable PDF creation using the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library):
-* [CDN](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references)
-* [NPM Package](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references#node-package-manager-npm)
-* [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator)
-For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
-Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction.
+- [CDN](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references)
+- [NPM Package](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references#node-package-manager-npm)
+- [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator)
-Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
+N> The `31.2.15` CDN version is compatible with the .NET 8 and .NET 9 target frameworks. If you use a different Syncfusion version in your application, replace the CDN URL with the matching version.
+
+## Generate the PDF
+
+Step 6: Create a PDF document: open `~/Views/Home/Index.cshtml` and add a button plus a click handler that uses the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) to generate a PDF in the browser.
{% tabs %}
{% highlight cshtml tabtitle="~/Index.cshtml" %}
@@ -55,32 +81,81 @@ Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml`
@section Scripts {
}
{% endhighlight %}
{% endtabs %}
-Step 7: **Build the project**: Click on Build > Build Solution or press Ctrl + Shift + B to build the project.
+## Code Explanation
+
+- `ej.pdf.PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object.
+- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. The rectangle object has the shape `{ x, y, width, height }`.
+- `graphics.clientSize.width` — the writable width of the page in points.
+- `save('output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server. The call is synchronous in the browser build.
+- `destroy()` — releases native resources held by the document. It is safe to call immediately after `save()` because the download is initiated before the document is destroyed.
+
+## Build and Run the Application
+
+Step 7: Build the project: click **Build** > **Build Solution** or press **Ctrl + Shift + B** to build the project.
+
+Step 8: Run the project: click the **Start** button (green arrow) or press **F5** to run the app. Visual Studio launches the app in your default browser.
+
+After running the application, click **Generate PDF document**. The browser downloads `output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left.
+
+
+
+## Additional Configuration (Optional)
+
+N> The following steps are required **only** if you need image or data extraction features. They are not required for the basic PDF creation shown in this guide.
+
+If you need image and data extraction, install the data-extraction add-on and copy the `ej2-pdf-lib` folder into your project.
+
+1. Install the add-on package:
+
+ ```bash
+ npm install @syncfusion/ej2-pdf-data-extract --save
+ ```
+
+2. Copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into `wwwroot/lib/ej2-pdf-lib/`. The folder must contain the required `.js` and `.wasm` files.
+
+3. Confirm that the `ej2-pdf-lib` folder is reachable at runtime (for example, at `https://localhost:xxxx/lib/ej2-pdf-lib/`).
+
+## Troubleshooting
-Step 8: **Run the project**: Click the Start button (green arrow) or press F5 to run the app.
+| Problem | Cause | Resolution |
+|---|---|---|
+| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the `
@@ -36,43 +55,125 @@ Step 3: Create a HTML page (index.html) in `my-app` location and add the CDN lin
{% endhighlight %}
{% endtabs %}
-N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
-Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction.
-
-Step 4: **Create a PDF document**: Add the script in `index.html` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
+Step 3: Create a complete `index.html` inside `my-app` with the following content. The CDN reference is loaded in the `` and the PDF generation script is placed at the end of `` so the button exists before the click handler is attached.
{% tabs %}
-{% highlight javascript tabtitle="index.html" %}
-
-}
+
+
{% endhighlight %}
{% endtabs %}
-By executing the program, you will get the PDF document as follows.
+N> The script tag is placed at the end of `` so that `document.getElementById('createPdf')` finds the button. If you prefer to put the script in ``, wrap the listener registration in a `DOMContentLoaded` event.
+
+## Code Explanation
+
+- `ej.pdf.PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object.
+- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. The layout rect is `{ x, y, width, height }`.
+- `graphics.clientSize.width` — the writable width of the page in points.
+- `save('Output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server.
+- `destroy()` — releases native resources held by the document.
+
+## Run the Sample
+
+Step 4: Open a terminal in the `my-app` folder and start a static file server.
+
+Using `npx serve` (no install required):
+
+```bash
+npx serve
+```
+
+Step 5: Open the served URL in your browser. For `npx serve`, the default URL is `http://localhost:3000`. For Python, the default URL is `http://localhost:8000`.
+
+Click **Generate PDF document**. The browser downloads `Output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left.
+
+
+
+## Additional Configuration (Optional)
+
+N> The following steps are required **only** if you need image or data extraction features. They are not required for the basic PDF creation shown in this guide.
+
+If you need image and data extraction, install the data-extraction add-on and copy the `ej2-pdf-lib` folder into the served directory.
+
+1. Install the add-on package:
+
+ ```bash
+ npm install @syncfusion/ej2-pdf-data-extract --save
+ ```
+
+2. Copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into the same folder as `index.html`. The folder must contain the required `.js` and `.wasm` files.
+
+3. Confirm that the `ej2-pdf-lib` folder is reachable from the served page (for example, at `http://localhost:3000/ej2-pdf-lib/`).
+
+## License Registration
+
+N> This guide uses the CDN distribution of the JavaScript PDF Library. No client-side `registerLicense` call is required when loading the library from the Syncfusion CDN; licensing is handled at the account level. If you switch to the NPM-based packages, add a `registerLicense('YOUR_LICENSE_KEY')` call in your entry script.
+
+## Troubleshooting
+
+| Problem | Cause | Resolution |
+|---|---|---|
+| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the `` reference is reachable and not blocked by an ad blocker or network policy |
+| `@section Scripts` appears as plain text on the page | The file is a static `.html`, not an ASP.NET view | Replace the Razor block with a plain `
{% endhighlight %}
@@ -62,22 +148,22 @@ import { PdfDocument, PdfGraphics, PdfPage, PdfFont, PdfFontFamily, PdfFontStyle
{% endhighlight %}
{% endtabs %}
-* Include the following code example in the click event of the button in `index.ts` to generate a PDF document
+* Include the following code example in the click event of the button in `index.ts` to generate a PDF document
{% tabs %}
{% highlight typescript tabtitle="index.ts" %}
document.getElementById('normalButton').onclick = (): void => {
// Create a new PDF document
- let pdf = new PdfDocument();
+ const pdf = new PdfDocument();
// Add a new page
- let page: PdfPage = pdf.addPage();
+ const page: PdfPage = pdf.addPage();
// Get graphics from the page
- let graphics: PdfGraphics = page.graphics;
+ const graphics: PdfGraphics = page.graphics;
// Set font
- let font: PdfFont = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
+ const font: PdfFont = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
// Create a new black brush
- let brush = new PdfBrush({r: 0, g: 0, b: 0});
+ const brush = new PdfBrush({r: 0, g: 0, b: 0});
// Draw text
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
// Save and download PDF
@@ -89,14 +175,54 @@ document.getElementById('normalButton').onclick = (): void => {
{% endhighlight %}
{% endtabs %}
-* **Run the application**
+## Code Explanation
+
+- `registerLicense(key)` — registers the Syncfusion license key at application startup. Required for commercial usage.
+- `PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object.
+- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`.
+- `graphics.clientSize.width` — the writable width of the page in points.
+- `save('output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder.
+- `destroy()` — releases native resources held by the document.
-The quickstart project is configured to compile and run in the browser. Use the following command to start the application:
+## Run the application
+
+The quickstart project is configured to compile and run in the browser. Use the following command from the project root to start the application:
```bash
npm start
```
+Vite serves the application at `http://localhost:5173`. Open this URL in a browser and click **Create PDF document** to download the generated file as `output.pdf`.
+
+The generated PDF contains a single page with the text "Hello World!!!" drawn at the top-left.
+
By executing the program, you will get the PDF document as follows.
-
\ No newline at end of file
+
+
+N> The first run may take a few seconds while Vite optimizes dependencies. Subsequent runs are faster.
+
+## Troubleshooting
+
+| Problem | Cause | Resolution |
+|---|---|---|
+| `Error: Cannot find module '@syncfusion/ej2-pdf'` | The package is not installed | Run `npm install @syncfusion/ej2-pdf --save` |
+| `TS2304: Cannot find name 'PdfDocument'` (or similar) | The import line is missing | Confirm the `import` block at the top of `index.ts` is present |
+| Button click does nothing | The button ID does not match | Confirm the button's `id` is `normalButton` |
+| `Failed to resolve import "@syncfusion/ej2-pdf"` | The bundler cannot resolve the package | Confirm `node_modules/` exists and that you ran `npm install` |
+| `ReferenceError: document is not defined` | The code ran in a Node-only context (e.g., SSR) | This sample is browser-only; run it in a browser via `npm start` |
+| `Cannot GET /` | The dev server is not running | Run `npm start` and wait for "Local: http://localhost:5173/" |
+| PDF does not download | The browser blocks the download | Check the browser's download settings and downloads folder |
+| `registerLicense` warning at runtime | The license key is missing or invalid | Confirm the key is set in `index.ts` and is the correct key for your Syncfusion account |
+
+## See Also
+
+- [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library)
+- [JavaScript PDF Library documentation](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/overview)
+- [JavaScript PDF Library API reference](https://ej2.syncfusion.com/documentation/api/pdf)
+- [JavaScript PDF Library examples](https://document.syncfusion.com/demos/pdf/javascript/#/fluent2/pdf/default)
+- [Syncfusion licensing documentation](https://help.syncfusion.com/document-processing/licensing/overview)
\ No newline at end of file
diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md
index a66fb8ec30..7ac50e00c8 100644
--- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md
+++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md
@@ -1,109 +1,248 @@
---
layout: post
-title: Create or Generate PDF file in Vue | Syncfusion
-description: Learn how to create a PDF file in Vue with easy steps using JavaScript PDF Library without depending on Adobe
+title: Create or Generate a PDF File in a Vue Application | Syncfusion
+description: Learn how to create a PDF file in a Vue application with easy steps using the JavaScript PDF Library without requiring Adobe Acrobat.
control: PDF
platform: document-processing
documentation: ug
-keywords: pdf, script, vue, javascript
+keywords: pdf, vue, vue 3, vue 2, javascript
+canonical_url: https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-vue
---
-# Create or Generate PDF file in Vue application
+# Create or Generate a PDF File in a Vue Application
-The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill forms, and secure PDF files.
+The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill PDF forms, and secure PDF files.
-This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an Vue application.
+This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into a Vue application that runs in the browser. The generated PDF is downloaded directly from the browser; no server-side PDF rendering is required.
-## Setting up the Vue 2 project
+> Vue 2 reached end-of-life on December 31, 2023. This guide leads with **Vue 3** (recommended) and provides a separate Vue 2 path for legacy projects.
-To generate a Vue 2 project using Vue-CLI, use the [Vue create](https://cli.vuejs.org/#getting-started) command. Follow these steps to install Vue CLI and create a new project:
+## Prerequisites
+
+Before you begin, make sure you have the following installed:
+
+- Node.js 18 or later.
+- npm 9 or later, or Yarn 1.22 or later.
+- Visual Studio Code, Code Studio, or another code editor.
+- A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox.
+
+To verify your Node.js and npm versions, run:
```bash
-npm install -g @vue/cli
-vue create quickstart
-cd quickstart
+node --version
+npm --version
+```
+
+## Create a Vue 3 Project (Recommended)
+
+Create a new Vue 3 project using the official scaffolding tool. This guide uses [Vite](https://vitejs.dev/) as the bundler.
+
+```bash
+npm create vue@latest my-pdf-app
+cd my-pdf-app
+npm install
+```
+
+When prompted, choose the default options (TypeScript is optional; this guide uses plain JavaScript).
+
+The final project structure is:
+
+```text
+my-pdf-app/
+├── public/
+├── src/
+│ ├── App.vue
+│ ├── main.js
+│ └── components/
+├── index.html
+└── package.json
```
-or
+## Create a Vue 2 Project (Legacy)
+
+N> Vue 2 reached end-of-life on December 31, 2023. Use Vue 2 only for legacy projects.
+
+To create a Vue 2 project using the legacy Vue CLI:
```bash
-yarn global add @vue/cli
+npm install -g @vue/cli
vue create quickstart
cd quickstart
```
-When creating a new project, choose the option `Default ([Vue 2] babel, es-lint)` from the menu.
+When prompted, choose `Default ([Vue 2] babel, es-lint)`.

-Once the `quick start` project is set up with default settings, proceed to add Syncfusion® components to the project.
+## Install the JavaScript PDF Library
-* **Installing JavaScript PDF package**
-
-All Syncfusion JS 2 packages are published in `npmjs.com` registry.
+All Syncfusion® JS 2 packages are published in the `npmjs.com` registry. The `npm install` command below resolves `@syncfusion/ej2-pdf` to the latest stable version compatible with Vue 2.7+ or Vue 3.4+.
* To install the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library), use the following command.
```bash
npm install @syncfusion/ej2-pdf --save
```
-or
+
+* If you prefer Yarn, use the following command.
+
```bash
yarn add @syncfusion/ej2-pdf
```
-N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
-* Copy the `ej2-pdf-lib` folder from the @syncfusion/ej2-pdf-data-extract package into your project's **public, dist, or assets** directory (where your static files are served).
-* Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files.
-* Ensure your server serves .wasm files with the **Content-Type: application/wasm** MIME type.
-* This setup is not required for **basic PDF creation**.
+N> For image and data extraction features, install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. Note the following:
+- Copy the `ej2-pdf-lib` folder from the `@syncfusion/ej2-pdf-data-extract` package into your project's `public/`, `dist/`, or `assets/` directory (wherever your static files are served).
+- Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files.
+- Ensure your server serves `.wasm` files with the **Content-Type: application/wasm** MIME type. Vite and Vue CLI dev servers already handle this; configure production servers manually.
+- This setup is not required for **basic PDF creation**.
+
+### Transitive Dependencies
+
+The following packages are included automatically by `@syncfusion/ej2-pdf` and do not need to be installed separately:
+
+- `@syncfusion/ej2-base` — common utilities used by the library.
+- `@syncfusion/ej2-compression` — compression support used by PDF features.
-* **Create a PDF document**: Add the script in `App.vue` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
+## License Registration
+
+If your project requires a Syncfusion license, register the license key before using the PDF API. Add the following code at the top of `src/App.vue`'s `
+
+
+
+
+
+
{% endhighlight %}
{% endtabs %}
-## Run the project
+N> This sample uses **named imports** from the npm package (`import { PdfDocument, ... } from '@syncfusion/ej2-pdf'`). The npm package does not expose a global `ej` namespace; using `ej.pdf.PdfDocument` without an import will throw `ReferenceError: ej is not defined` in a Vite or Vue CLI build. If you prefer the UMD-style global, load `ej2.min.js` from the Syncfusion CDN in `index.html` (or `public/index.html`) instead of importing the npm package.
+
+N> A click handler is used in this example, so no additional setup is required. The PDF classes load when the import runs at module evaluation time, which happens before any user interaction.
-To run the project, use the following command:
+## Code Explanation
+
+- `registerLicense(key)` — registers the Syncfusion license key at application startup. Required for commercial usage.
+- `PdfDocument` — creates a new PDF document instance.
+- `addPage()` — appends a blank page to the document and returns the `PdfPage` object.
+- `page.graphics` — returns the `PdfGraphics` drawing surface for the page.
+- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object.
+- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black.
+- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`.
+- `graphics.clientSize.width` — the writable width of the page in points.
+- `save('Output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder.
+- `destroy()` — releases native resources held by the document.
+
+## Run the Application
+
+### Vue 3 (Vite)
+
+Open a terminal in the project root and start the Vite development server:
```bash
-npm run serve
+npm run dev
```
-or
+
+Vite serves the application at `http://localhost:5173`. Open this URL in a browser and click **Create PDF document** to download the generated file as `Output.pdf`.
+
+### Vue 2 (Vue CLI)
+
+Open a terminal in the project root and start the Vue CLI development server:
```bash
-yarn run serve
+npm run serve
```
-By executing the program, you will generate the following PDF document.
+Vue CLI serves the application at `http://localhost:8080`. Open this URL in a browser and click **Create PDF document** to download the generated file as `Output.pdf`.
+
+The generated PDF contains a single page with the text "Hello World!!!" drawn at the top-left.

+
+## Troubleshooting
+
+| Problem | Cause | Resolution |
+|---|---|---|
+| `ReferenceError: ej is not defined` | The code uses the global `ej.pdf` namespace but the npm package does not expose it | Switch to named imports: `import { PdfDocument, ... } from '@syncfusion/ej2-pdf'` |
+| `SyntaxError: Unexpected token ':'` in `App.vue` | TypeScript type annotations were left in a plain `
{% endhighlight %}
{% endtabs %}
@@ -98,7 +126,7 @@ N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/app
## Add Blazor Spreadsheet component
-Add the Blazor Spreadsheet component in any Razor file. In this example, the Spreadsheet component is added to the **~/Home.razor** page under the **~/Components/Pages** folder.
+Add the Blazor Spreadsheet component in any Razor file. In this example, the Spreadsheet component is added to the **Components/Pages/Home.razor** page.
{% tabs %}
{% highlight razor tabtitle="Home.razor" %}
@@ -113,6 +141,10 @@ Add the Blazor Spreadsheet component in any Razor file. In this example, the Spr
{% endhighlight %}
{% endtabs %}
+N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI.
+
+N> .NET MAUI Blazor Hybrid apps run components natively on the device; no interactive render mode (such as `InteractiveServer` or `InteractiveWebAssembly`) is required.
+
## Run on Windows
In the Visual Studio toolbar, click the **Windows Machine** to build and run the app. Ensure the run profile is set to `Windows Machine` before starting the app.
@@ -127,18 +159,22 @@ After the application launches, the output will appear as shown below:
To run the Spreadsheet on Android using the Android emulator, follow these steps:
-Refer [here](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/device-manager#android-device-manager-on-windows) to install and launch Android emulator.
+1. Refer to [Android Device Manager on Windows](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/device-manager#android-device-manager-on-windows) to install and launch the Android emulator.
+2. In the Visual Studio toolbar, select the **Android Emulators** run profile.
+3. Click the **Android Emulators** button (or press F5) to build and deploy the app to the emulator.
N> If any errors occur while using the Android Emulator, see [Troubleshooting Android Emulator](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/troubleshooting).
+N> To run the app on iOS or Mac Catalyst, see [Publish a .NET MAUI app for iOS](https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/overview) and [Publish a .NET MAUI app for Mac Catalyst](https://learn.microsoft.com/en-us/dotnet/maui/mac-catalyst/deployment/?view=net-maui-10.0).
+

To learn how to open workbooks, bind data, or save files in the Spreadsheet component, see [Open and Save](open-and-save).
-N> [View Sample In GitHub.](https://github.com/SyncfusionExamples/syncfusion-maui-blazor-spreadsheet-integration). Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page
+N> [View sample in GitHub](https://github.com/SyncfusionExamples/syncfusion-maui-blazor-spreadsheet-integration). Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page
## See Also
- [Getting started with the Blazor Spreadsheet in a Blazor WebAssembly App](./getting-started)
-- [Getting started with the Blazor Spreadsheet in a Blazor Web app Server app](./getting-started-webapp)
\ No newline at end of file
+- [Getting started with the Blazor Spreadsheet in a Blazor Web App](./getting-started-webapp)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md
index f57683d710..f96575242f 100644
--- a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md
+++ b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md
@@ -7,7 +7,7 @@ control: Spreadsheet
documentation: ug
---
-# Getting Started with the Blazor Spreadsheet in Web App
+# Getting Started with the Blazor Spreadsheet in Blazor Web App
This section briefly explains how to include the [Blazor Spreadsheet Editor](https://www.syncfusion.com/blazor-components/blazor-spreadsheet) component in a Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/).
@@ -27,7 +27,7 @@ N> Configure the appropriate [Interactive render mode](https://learn.microsoft.c
## Install Blazor Spreadsheet NuGet Packages
-If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Blazor components NuGet packages within the client project.
+If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project.
To add **Syncfusion Blazor Spreadsheet** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install:
@@ -73,9 +73,11 @@ cd BlazorWebApp.Client
N> For more information on creating a Blazor Web App with various interactive modes and locations, see [Render interactive modes](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=visual-studio-code#render-interactive-modes).
+N> If you selected the `Server` interactive render mode (no client project is created), skip the `cdn BlazorWebApp.Client` command and run package commands from the server project directory.
+
## Install Blazor Spreadsheet NuGet Packages
-If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App need to be install Blazor components NuGet packages within the client project.
+If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project.
* Press Ctrl+` to open the integrated terminal in Visual Studio Code.
* Ensure you’re in the project root directory where your `.csproj` file is located.
@@ -93,13 +95,16 @@ dotnet restore
{% endtabs %}
+N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry.
+
+
{% endtabcontent %}
{% tabcontent .NET CLI %}
## Prerequisites
-Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux).
+Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux). Also, review the [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements).
{% tabs %}
{% highlight c# tabtitle=".NET CLI" %}
@@ -125,9 +130,11 @@ cd BlazorWebApp.Client
{% endhighlight %}
{% endtabs %}
+N> If you selected the `Server` interactive render mode (no client project is created), skip the `cdn BlazorWebApp.Client` command and run package commands from the server project directory.
+
## Install Syncfusion® Blazor Spreadsheet and Themes NuGet in the App
-If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App need to be install Blazor components NuGet packages within the client project.
+If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project.
* Open a command prompt, terminal, or shell.
* Ensure you’re in the project root directory where your `.csproj` file is located (or the Client project if applicable).
@@ -145,13 +152,15 @@ dotnet restore
{% endtabs %}
+N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry.
+
{% endtabcontent %}
{% endtabcontents %}
## Add import namespaces
-After the packages are installed, open the **~/_Imports.razor** file in the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces.
+After the packages are installed, open the **_Imports.razor** file (typically located at `Components/_Imports.razor` in Blazor Web App templates; in older templates or WebAssembly apps it may be at the project root) and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces.
{% tabs %}
{% highlight C# tabtitle="_Imports.razor" %}
@@ -162,6 +171,7 @@ After the packages are installed, open the **~/_Imports.razor** file in the clie
{% endhighlight %}
{% endtabs %}
+
## Register Syncfusion® Blazor Service
Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor Web App.
@@ -169,55 +179,68 @@ Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor
{% tabs %}
{% highlight c# tabtitle="Program.cs" %}
-....
using Syncfusion.Blazor;
-....
+// Register Syncfusion Blazor service
builder.Services.AddSyncfusionBlazor();
-....
{% endhighlight %}
{% endtabs %}
-N> If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Blazor service in **Program.cs** files of both the server and client projects in your Blazor Web App.
+N> If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Blazor service in **Program.cs** files of both the server and client projects in your Blazor Web App. For `Server` render mode, register it in the server project's **Program.cs** only.
+
+N> `AddSyncfusionBlazor()` accepts optional configuration options such as enabling script isolation. See the [Blazor service registration](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.GlobalOptions.html) topic for available configuration options.
-## Add stylesheet and script resources
+## Register Syncfusion License Key
-The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the
section and the script reference at the end of the