DocumentLab-x64 1.2.0

There is a newer version of this package available.
See the version list below for details.

Requires NuGet 4.7.0.0 or higher.

dotnet add package DocumentLab-x64 --version 1.2.0
NuGet\Install-Package DocumentLab-x64 -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DocumentLab-x64" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DocumentLab-x64 --version 1.2.0
#r "nuget: DocumentLab-x64, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DocumentLab-x64 as a Cake Addin
#addin nuget:?package=DocumentLab-x64&version=1.2.0

// Install DocumentLab-x64 as a Cake Tool
#tool nuget:?package=DocumentLab-x64&version=1.2.0

Fluent C# interface to DocumentLab

If scripts aren't your thing and you'd prefer to use a C# interface to DocumentLab when extracting data from document images you can use the fluent query extensions.

Data is always returned contained in a string object. It is up to the caller to do any necessary type conversions.

Header

using DocumentLab;
using System.Drawing;

Implementation

using (var dl = new Document((Bitmap)Image.FromFile("pathToSomeImage.png")))
{
  // We know our documents have the customer number to the right of the labels we know of, we can be very specific about the direction
  string customerNumber = dl.Query().GetValueForLabel(Direction.Right, "Customer number", "Cust no");

  // We can ask DocumentLab to find the closest to the labels. The text type of the value to match is by default "Text".
  string invoiceNumber = dl.Query()FindValueForLabel("Invoice number");

  // Here we ask DocumentLab to specifically find a date value for the specified label
  string dueDate = dl.Query()FindValueForLabel(TextType.Date, "Due date");

  // We can build patterns using predicates, directions and capture operations that return the value matched in the document
  string receiverName = dl
    .Query()
    .Match("PostCode") // All methods with text type parameters offer the TextType enum as well as a string variant of the method, this is because dynamically loaded contexgtual data files aren't statically defined
    .Up()
    .Match("Town")
    .Up()
    .Match("StreetAddress")
    .Up()
    .Capture(TextType.Text)

  // We can build patterns that yield multiple results, the results need to be named and the response is a Dictionary<string, string>
  Dictionary<string, string> receiverInformation = dl
    .Query()
    .Capture(q => q
      .Capture("PostCode")
      .Up()
      .Capture("Town")
      .Up()
      .Capture("StreetAddress")
      .Up()
      .Capture("TextType.Text")
    );

  // We can ask for all dates in a document by using the GetAny method
  string[] dates = dl.Query().GetAny(TextType.Date);
}
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.0 2,252 2/18/2020
1.2.0 1,737 1/4/2020
1.1.1 1,736 12/28/2019
1.1.0 1,757 12/27/2019
1.0.0 1,637 12/19/2019