diff --git a/Document-Processing/Data-Extraction/NET/conversions/pdf-to-json.md b/Document-Processing/Data-Extraction/NET/conversions/pdf-to-json.md index dc79f92422..7c9cbfa71d 100644 --- a/Document-Processing/Data-Extraction/NET/conversions/pdf-to-json.md +++ b/Document-Processing/Data-Extraction/NET/conversions/pdf-to-json.md @@ -1,6 +1,6 @@ --- title: Convert PDF to JSON in .NET Smart Data Extractor | Syncfusion -description: Extract structured data from PDF as JSON using Smart Data Extractor. Convert PDF content into machine-readable JSON format seamlessly in .NET applications. +description: Extract structured data from PDF documents as JSON using Smart Data Extractor. platform: document-processing control: SmartDataExtractor documentation: UG diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Features.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Features.md index 4c21258b2f..138192cad9 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Features.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Features.md @@ -9,7 +9,7 @@ keywords: Assemblies # Perform OCR on PDF and image files in .NET -## Performing OCR for an entire document +## Perform OCR on PDF and image files in .NET To perform OCR for an 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. Refer to the following code example. diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Getting-started-overview.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Getting-started-overview.md index 2d7b27df5e..cdaac99498 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Getting-started-overview.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Getting-started-overview.md @@ -1,12 +1,12 @@ --- title: Getting Started with Syncfusion .NET OCR Processor | Syncfusion canonical_url: "https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process" -description: Learn about how to getting started with Syncfusion .NET OCR Processor for extracting text from scanned image and more details. +description: Learn about how to getting started with Syncfusion .NET OCR Processor and more details. platform: document-processing control: PDF documentation: UG --- -# Getting Started with Syncfusion .NET OCR Processor +# About Syncfusion .NET OCR Processor Library To quickly get started with extracting text from scanned PDF documents in .NET using the .NET OCR processor library, refer to this video tutorial: {% youtube "https://www.youtube.com/watch?v=VhN7ETn0vyA" %} diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-cSharp-and-VB.md b/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-cSharp-and-VB.md deleted file mode 100644 index d16bd40ab4..0000000000 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-cSharp-and-VB.md +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: How to perform OCR for a PDF document using C# and VB.NET | Syncfusion -description: This section explains how to perform OCR for a PDF document using Syncfusion .NET OCR Processor in C# and VB.NET. -platform: document-processing -control: PDF -documentation: UG ---- - -# How to perform OCR for a PDF document using C# and VB.NET - -Essential® PDF provides support for Optical Character Recognition with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) OCR engine. With a few lines of code, a scanned PDF document containing a raster image is converted into a searchable and selectable PDF document. - -N> Starting with v20.1.0.x, if you reference Syncfusion® OCR processor assemblies from trial setup or from the NuGet feed, you also have to 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. - -To use the .NET OCR processor library in your application, you need to add reference to the following set of assemblies. - -Syncfusion assemblies -1. Syncfusion.Compression.Base.dll -2. Syncfusion.Pdf.Base.dll -3. Syncfusion.OcrProcessor.Base.dll - -Tesseract assemblies -* Syncfusion.Tesseract.dll (Tesseract Engine Version 4.0) -* liblept168.dll (Leptonica image processing library used by Tesseract engine) - -## Steps to perform OCR on a entire PDF document programmatically - -1.Create a new C# Windows Forms application project. -WF sample creation step1 - -2.Install [Syncfusion.Pdf.OCR.WinForms](https://www.nuget.org/packages/Syncfusion.PDF.OCR.WinForms/) NuGet packages as reference to your .NET Framework application from [NuGet.org](https://www.nuget.org/). -Install NuGet - -3.Include the following namespaces in the Form1.cs file. - -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -using Syncfusion.Pdf.Parsing; -using Syncfusion.OCRProcessor; - -{% endhighlight %} - -{% highlight c# tabtitle="VB.NET" %} - -Imports Syncfusion.Pdf.Parsing -Imports Syncfusion.OCRProcessor - -{% endhighlight %} - -{% endtabs %} - -4.Tesseract assemblies are not added as a reference. They must be kept in the local machine, and the location of the assemblies are passed as a parameter to the OCR processor. - -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -OCRProcessor processor = new OCRProcessor(@"TesseractBinaries/") - -{% endhighlight %} - -{% highlight vb.net tabtitle="VB.NET" %} - -Dim processor As New OCRProcessor("TesseractBinaries/") - -{% endhighlight %} - -{% endtabs %} - -5.Place the Tesseract language data {E.g eng.traineddata} in the local system and provide a path to the OCR processor. - -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -OCRProcessor processor = new OCRProcessor(@"TesseractBinaries/"); -processor.PerformOCR(lDoc, @"TessData/"); - -{% endhighlight %} - -{% highlight vb.net tabtitle="VB.NET" %} - -Dim processor As New OCRProcessor("TesseractBinaries/") -processor.PerformOCR(lDoc, "TessData/") - -{% endhighlight %} - -{% endtabs %} - -6.Use the following code snippet to process OCR on a entire PDF document. - -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -//Initialize the OCR processor by providing the path of tesseract binaries(SyncfusionTesseract.dll and liblept168.dll) -using (OCRProcessor processor = new OCRProcessor("TesseractBinaries/4.0/x86/")) -{ - //Load the PDF document - PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf"); - - //Set OCR language to process - processor.Settings.Language = Languages.English; - - //Set the tesseract version - processor.Settings.TesseractVersion = TesseractVersion.Version4_0; - - //Process OCR by providing the PDF document and Tesseract data - processor.PerformOCR(loadedDocument, "Tessdata/"); - - //Save the OCR processed PDF document in the disk - loadedDocument.Save("Sample.pdf"); - loadedDocument.Close(true); -} - -{% endhighlight %} - -{% highlight vb.net tabtitle="VB.NET" %} - -'Initialize the OCR processor by providing the path of tesseract binaries(SyncfusionTesseract.dll and liblept168.dll) -Using processor As OCRProcessor = New OCRProcessor("TesseractBinaries/4.0/x86/") - - 'Load the PDF document - Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("Input.pdf") - - 'Set OCR language to process - processor.Settings.Language = Languages.English - - 'Set the tesseract version - processor.Settings.TesseractVersion = TesseractVersion.Version4_0 - - 'Process OCR by providing the PDF document and Tesseract data - processor.PerformOCR(loadedDocument, "Tessdata/") - - 'Save the OCR processed PDF document in the disk - loadedDocument.Save("Sample.pdf") - loadedDocument.Close(True) - -End Using - -{% endhighlight %} - -{% endtabs %} - -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/OCR/.NET%20Framework/Windows%20Forms). - -By executing the program, you will get the PDF document (contains selectable text) as follows. -![output-pdf](OCR-Images/OCR-output-image.png) - - - diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-net-Core.md b/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-net-Core.md deleted file mode 100644 index 6f98170c1c..0000000000 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/how-to-perform-ocr-for-a-pdf-document-using-net-Core.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: How to perform OCR on a PDF document using ASP.Net Core | Syncfusion -description: This section explains how to perform OCR on an entire PDF document using the Syncfusion .NET OCR Processor. -platform: document-processing -control: PDF -documentation: UG ---- - -# How to perform OCR on a PDF document using ASP.NET Core - -Optical Character Recognition (OCR) is a technology that converts scanned paper documents from PDF files or images into searchable and editable data. - -The [.NET OCR processor library](https://www.syncfusion.com/document-processing/pdf-framework/net/pdf-library/ocr-process) has extended support to process OCR on scanned PDF documents and other scanned images in the .NET Core platform with the help of the [Tesseract](https://github.com/tesseract-ocr/tesseract) OCR engine. - -## Steps to perform OCR on a PDF document programmatically - -1.Create a new C# ASP.NET Core Web application project. - .NET Core sample creation step1 - -2.In the project configuration window, name your project and select Next. - .NET Core sample creation step2 - .NET Core sample creation step3 - -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 application from [nuget.org](https://www.nuget.org/). - Installation of .NET Core NuGet package - -4.Tesseract assemblies are not added as a reference. They must be kept in the local machine, and the location of the assemblies is passed as a parameter to the OCR processor. -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\") - -{% endhighlight %} - -{% endtabs %} - -5.Place the Tesseract language data {E.g eng.traineddata} in the local system and provide a path to the OCR processor. Please use the OCR language data for other languages using the following link, -https://github.com/tesseract-ocr/tessdata - -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -OCRProcessor processor = new OCRProcessor("Tesseractbinaries\"); -processor.PerformOCR(loadedDocument, "tessdata/"); - -{% endhighlight %} - -{% endtabs %} - -6.A default action method named Index will be present in HomeController.cs. Right-click on Index method and select Go to View, where you will be directed to its associated view page Index.cshtml. -7.Add a new button in the Index.cshtml as shown below. - -{% highlight c# tabtitle="C#" %} - -@{Html.BeginForm("PerformOCR", "Home", FormMethod.Get); - { -
- -
- } - Html.EndForm(); -} - -{% endhighlight %} - -8.A default controller with name HomeController.cs is added to the creation of ASP.NET Core project. Include the following namespaces in that HomeController.cs file. -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -using Syncfusion.Pdf.Parsing; -using Syncfusion.OCRProcessor; -using System.Drawing; - -{% endhighlight %} - -{% endtabs %} - -10.Use the following code sample to perform OCR in the ASP.NET Core application. -{% tabs %} - -{% highlight c# tabtitle="C#" %} - -//Load PDF document as stream -string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf"; -FileStream docStream = new FileStream(docPath, FileMode.Open, FileAccess.Read); -//Load the PDF document -PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream); -string tesseractPath = _hostingEnvironment.WebRootPath + "/Data/Tesseractbinaries/Windows"; -//Initialize the OCR processor by providing the path of tesseract binaries -using (OCRProcessor processor = new OCRProcessor(tesseractPath)) -{ - //Language to process the OCR - processor.Settings.Language = Languages.English; - - string tessdataPath = _hostingEnvironment.WebRootPath + "/Data/tessdata/"; - //Process OCR by providing loaded PDF document, Data dictionary and language - processor.PerformOCR(loadedDocument, tessdataPath); -} -//Saving the PDF to the MemoryStream -MemoryStream stream = new MemoryStream(); -loadedDocument.Save(stream); -//Close the PDF document -loadedDocument.Close(true); -//Set the position as '0' -stream.Position = 0; -//Download the PDF document in the browser -FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf"); -fileStreamResult.FileDownloadName = "Sample.pdf"; -return fileStreamResult; - -{% endhighlight %} - -{% endtabs %} - -A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/OCR/.NET%20Core). - -By executing the program, you will get the text file (contains extracted text) as follows. -![output pdf](OCR-images/OCR-output-image.png) - - - diff --git a/Document-Processing/Data-Extraction/NET/working-with-form-recognition.md b/Document-Processing/Data-Extraction/NET/working-with-form-recognition.md index 31ffff7fd0..d3a535447d 100644 --- a/Document-Processing/Data-Extraction/NET/working-with-form-recognition.md +++ b/Document-Processing/Data-Extraction/NET/working-with-form-recognition.md @@ -1,6 +1,6 @@ --- title: Form Recognition in .NET Smart Data Extractor | Syncfusion -description: Recognize form elements from PDF and scanned images using Smart Form Recognizer. Configure FormRecognizer to extract structured form data accurately in .NET. +description: Recognize form elements from PDF and scanned images using Smart Form Recognizer. platform: document-processing control: SmartFormRecognizer documentation: UG