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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 3, 2019 2:46:19 PM(UTC)
Josh Clark

Groups: Registered, Tech Support, Administrators
Posts: 54

Thanks: 2 times
Was thanked: 10 time(s) in 10 post(s)

Do you need to process documents such as drivers' licenses or invoices but require a solution in Java? Well LEADTOOLS supports forms recognition in Java as well as .NET. Here I have created a simplified sample project to demonstrate the use of our Forms SDK within Java. This project uses our sample driver's license images and masterforms found in the "Leadtools Images" folder after installing, but should work with any masterform you give it including custom ones.

To use AutoForms, you must first create an instance of both an OcrEngine, and a DiskMasterFormsRepository. These together are passed to the constructor of the AutoFormsEngine which is used to identify the form given and parse the values as specified by the masterform associated with it.

Below is the main body of the application:
Code:
// Setup
codecs = new RasterCodecs();
ocrEngine = OcrEngineManager.createEngine(OcrEngineType.LEAD);
ocrEngine.startup(codecs, null, null, null);
repository = new DiskMasterFormsRepository(codecs,
		"C:\\Users\\Public\\Documents\\LEADTOOLS Images\\Forms\\MasterForm Sets\\Driving License");
autoEngine = new AutoFormsEngine(repository, ocrEngine, null);

// Prepare the form image with some preprocessing (optional)
unknownForm = codecs.load(unknownFormFilepath);
//prepareForm(unknownForm);

// Attempt to match the unknownForm to one of the masterforms in repository
AutoFormsRunResult runResult = autoEngine.run(unknownForm, null, null, null);
if (runResult != null) {
	// Print out the form information on success
	printOutValues(runResult);
}


To run this demo, extract the contents of this zip file to C:\LEADTOOLS 20\Examples\Java. This should automatically reference the Jar files in the bin folder as well as DemoUtilities.java in the Common folder.
You can download the project here:
File Attachment(s):
Java Forms sample project.zip (4kb) downloaded 62 time(s).
Josh Clark
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

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.041 seconds.