You could utilize the LEADTOOLS Invoice Recognition SDK, creating a master form would allow you to identify the exact pieces of the invoice that you need and get the results of a scanned image as a key-value pair. As a disclaimer this is a paid SDK and I work for this vendor. The below link additionally has a sample project of how this could be done in Java.
https://www.leadtools.com/support/forum/posts/t12833-HOW-TO--Use-AutoForms-in-Java
// 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\\Invoice");
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);
}