diff --git a/Console/OCR-Processing-Console.slnx b/Console/OCR-Processing-Console.slnx new file mode 100644 index 0000000..ed8958f --- /dev/null +++ b/Console/OCR-Processing-Console.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Console/OCR-Processing-Console/Data/Input.pdf b/Console/OCR-Processing-Console/Data/Input.pdf new file mode 100644 index 0000000..5c2bf8c Binary files /dev/null and b/Console/OCR-Processing-Console/Data/Input.pdf differ diff --git a/Console/OCR-Processing-Console/OCR-Processing-Console.csproj b/Console/OCR-Processing-Console/OCR-Processing-Console.csproj new file mode 100644 index 0000000..dfb09cc --- /dev/null +++ b/Console/OCR-Processing-Console/OCR-Processing-Console.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + OCR_Processing_Console + enable + enable + + + + + + + diff --git a/Console/OCR-Processing-Console/Output/gitkeep.txt b/Console/OCR-Processing-Console/Output/gitkeep.txt new file mode 100644 index 0000000..e69de29 diff --git a/Console/OCR-Processing-Console/Program.cs b/Console/OCR-Processing-Console/Program.cs new file mode 100644 index 0000000..52804be --- /dev/null +++ b/Console/OCR-Processing-Console/Program.cs @@ -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); +} \ No newline at end of file