Aspose.OCR Invoice to Text for .NET

Aspose.OCR Invoice to Text for .NET is a specialized plug-in designed to streamline text extraction from individual scanned or photographed invoices, as well as batches of invoice images. By automating invoice OCR with RecognizeInvoice, you can convert invoice images into recognized text for downstream review, data entry, accounting workflows, or database import. The plug-in uses the same high-quality OCR core as Aspose.OCR and is focused on invoice image input with InvoiceRecognitionSettings.

Installation and Setup

Follow these steps to add Aspose.OCR Invoice to Text for .NET to your project:

  1. Install via NuGet or download the package from Aspose servers. For detailed instructions, see Installation .
  2. Configure metered licensing at application startup to avoid evaluation limitations. See Metered Licensing .

Supported Plugin Options

The plugin license enables these API capabilities:

API areaSupported options
Licensed methodRecognizeInvoice
Input typeInputType.SingleImage
Recognition settings typeInvoiceRecognitionSettings
Language selectionInvoiceRecognitionSettings.Language supports 154 Language enum values, including Auto, Multilanguage, and Universal
Invoice settingsLanguage, ThreadsCount, AutomaticColorInversion, AllowedCharacters, AllowedSymbols, IgnoredSymbols
Preprocessing filtersPreprocessingFilter.AutoSkew(), Binarize(), Resize(), Dilate(), Invert(), Rotate(), Scale(), ToGrayscale(), Threshold(), Median()
Area detection modeNot configurable for this plugin; InvoiceRecognitionSettings does not expose DetectAreasMode

Skew correction is configured through PreprocessingFilter.AutoSkew(). Manual rotation and other image cleanup steps can be configured with preprocessing filters such as Rotate(), Binarize(), ToGrayscale(), Threshold(), and Median(). Custom recognition areas, table-specific APIs, key-value templates, auto denoising, auto dewarping, contrast correction, and auto contrast are not listed for this plugin in the license service.

Supported Workflow

Use OcrInput with InputType.SingleImage, add invoice image files, configure InvoiceRecognitionSettings, and call RecognizeInvoice. Add multiple invoices with repeated input.Add(...) calls to recognize a batch in one request.

Example: Recognizing Invoices

Aspose.OCR.Metered metered = new Aspose.OCR.Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");

// Initialize OCR engine
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();

// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("invoice1.png");
input.Add("invoice2.jpg");

// Configure recognition settings
Aspose.OCR.InvoiceRecognitionSettings recognitionSettings = new Aspose.OCR.InvoiceRecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Latin;

// Perform invoice recognition
Aspose.OCR.OcrOutput results = recognitionEngine.RecognizeInvoice(input, recognitionSettings);

foreach (Aspose.OCR.RecognitionResult result in results)
{
    Console.WriteLine(result.RecognitionText);
}

// Save results
results[0].Save("invoice_result.txt", Aspose.OCR.SaveFormat.Text);
results.Save("invoice_result.pdf", Aspose.OCR.SaveFormat.Pdf);
results.Save("invoice_result.json", Aspose.OCR.SaveFormat.Json);

Output Formats and Saving Results

Use RecognitionResult.Save(...) to save a single recognized invoice image, OcrOutput.Save(...) to save the whole invoice batch, or AsposeOcr.SaveMultipageDocument(...) to combine several results into one output document.

Supported SaveFormat values are Text, Docx, Pdf, PdfNoImg, Xlsx, Xml, Json, HTML, EPUB, RTF, HOCR, Md, and Csv. Use Json, Xml, Csv, or Xlsx when the recognized invoice text must be passed to downstream validation, accounting, or data-entry workflows.

Features and Functionalities

Invoice-Specific OCR Engine

  • Tailored recognition models for printed and photographed invoices.
  • High tolerance for varying resolutions, noise levels, and skew angles.
  • Recognition of multiple languages and digit styles within the same document.

Tips and Best Practices

  • Pre-validate image resolution for more accurate OCR results.
  • For low-quality invoice images, apply supported preprocessing filters such as PreprocessingFilter.AutoSkew(), Rotate(), Binarize(), Threshold(), ToGrayscale(), or Median() before recognition.
  • Set ThreadsCount to 1 on low-powered machines to reduce CPU pressure; increase ThreadsCount on multi-core systems to speed up batch processing.
  • Always initialize Metered Licensing before invoking any OCR methods so the licensed plugin functionality is applied.

By following these guidelines and using the licensed RecognizeInvoice API, Aspose.OCR Invoice to Text for .NET enables invoice OCR from image input.

 English