Invoice Splitter API .NET
The .NET OCR SDK supports the Invoice Splitter API.
Using this sample, we are going to illustrate how to detect the pages of multiple invoices within the same document.
Quick-Start
using Mindee;
using Mindee.Input;
using Mindee.Product.InvoiceSplitter;
string apiKey = "my-api-key";
string filePath = "/path/to/the/file.ext";
// Construct a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);
// load an input source
var inputSource = new LocalInputSource(filePath);
// call the product asynchronously with auto-polling
var response = await mindeeClient
.EnqueueAndParseAsync<InvoiceSplitterV1>(inputSource);
// Print a summary of all the predictions
System.Console.WriteLine(response.Document.ToString());
// Print only the document-level predictions
// System.Console.WriteLine(response.Document.Inference.Prediction.ToString());
Output (RST):
########
Document
########
:Mindee ID: 15ad7a19-7b75-43d0-b0c6-9a641a12b49b
:Filename: default_sample.pdf
Inference
#########
:Product: mindee/invoice_splitter v1.1
:Rotation applied: No
Prediction
==========
:Invoice Page Groups:
:Page indexes: 0
:Page indexes: 1
Page Predictions
================
Page 0
------
:Invoice Page Groups:
Page 1
------
:Invoice Page Groups:
Field Types
Specific Fields
Invoice Splitter V1 Page Group
List of page group indexes.
An InvoiceSplitterV1PageGroup
implements the following attributes:
- PageIndexes (
int[]
): List of indexes of the pages of a single invoice. - Confidence (
double
): The confidence of the prediction.
Attributes
The following fields are extracted for Invoice Splitter V1:
Invoice Page Groups
PageGroups (List<InvoiceSplitterV1PageGroup>): List of page indexes that belong to the same invoice in the PDF.
foreach (var InvoiceSplitterV1PageGroupElem in result.Document.Inference.Prediction.InvoiceSplitterV1PageGroup)
{
System.Console.WriteLine(InvoiceSplitterV1PageGroupElem).Polygon;
}
Questions?
Updated 3 months ago