Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Monday, November 20, 2017 2:34:19 PM(UTC)


Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

This Visual Studio 2017 console project uses LEADTOOLS v20 Leadtools.Ocr.NETStandard nuget package to illustrate the minimum code required to OCR single page or multi-page files and save it as a plain text (TXT), Portable Document Format (PDF), or LEAD Temporary Document file (LTD).

The demo uses command line arguments to set the input file, output file, and output document type. Here are example argument lists:
-i "C:\Users\Public\Documents\LEADTOOLS Images\Leadtools.pdf" -o "D:\junk folder\Leadtools.pdf.txt" -f TXT
-i "C:\Users\Public\Documents\LEADTOOLS Images\OCR1.TIF" -o "C:\OCR1.pdf" -f PDF


The core OCR code can be summed up in a few lines:

codecs.Options.Load.AllPages = true;
image = codecs.Load(inputFile);

ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(codecs, null, null, OCR_ENGINE_PATH);

ocrDocument = ocrEngine.DocumentManager.CreateDocument();
ocrDocument.Pages.AddPages(image, 1, image.PageCount, null);
foreach (Leadtools.Ocr.IOcrPage page in ocrDocument.Pages)
ocrDocument.Save(outputFile, format, null);

File Attachment(s):
CS_CoreStd_SimpleOCR.zip (364kb) downloaded 240 time(s).

Before running this demo, please verify the DEVELOPER_LIC and DEVELOPER_KEY file paths exist and change the application arguments if desired.

Edited by moderator Friday, February 8, 2019 8:12:22 AM(UTC)  | Reason: Not specified

Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.035 seconds.