Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Console/OCR-Processing-Console.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Solution>
<Project Path="OCR-Processing-Console/OCR-Processing-Console.csproj" />
</Solution>
Binary file added Console/OCR-Processing-Console/Data/Input.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions Console/OCR-Processing-Console/OCR-Processing-Console.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>OCR_Processing_Console</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.PDF.OCR.Net.Core" Version="*" />
</ItemGroup>

</Project>
Empty file.
17 changes: 17 additions & 0 deletions Console/OCR-Processing-Console/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;

//Initialize the OCR processor.
using (OCRProcessor processor = new OCRProcessor())
{
//Load an existing PDF document.
PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf"));
//Set OCR language.
processor.Settings.Language = Languages.English;
//Perform OCR with input document and tessdata (Language packs).
processor.PerformOCR(document);
//Save the PDF document.
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
}
Loading