Extracting text from invoices

Contents
[ ]

Even a small business may deal with dozens of printed invoices per day. Manual re-typing is time consuming and error-prone, and even a single mistake may result in significant losses.

Aspose.OCR offers a special recognition algorithm that extracts text from scanned invoices, which can then be automatically sent to accounting programs, databases or banks.

To extract text from an invoice, use RecognizeInvoice method of AsposeOCR class.

This method allows you to customize recognition accuracy, performance, and other settings.

The method takes OcrInput object and returns a list of recognition results containing the invoice data.

AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput input  = new OcrInput(InputType.SingleImage);
input.add(os.path.join(self.dataDir, "invoice1.png"));
input.add(os.path.join(self.dataDir, "invoice2.png"));
// Recognition settings
InvoiceRecognitionSettings recognitionSettings = new InvoiceRecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Recognize invoices
ArrayList<RecognitionResult> results = api.RecognizeInvoice(input, recognitionSettings);
results.forEach((result) -> {
	System.out.println(result.recognition_text);
});