VISEOIberia.AI.Document
1.1.7
dotnet add package VISEOIberia.AI.Document --version 1.1.7
NuGet\Install-Package VISEOIberia.AI.Document -Version 1.1.7
<PackageReference Include="VISEOIberia.AI.Document" Version="1.1.7" />
<PackageVersion Include="VISEOIberia.AI.Document" Version="1.1.7" />
<PackageReference Include="VISEOIberia.AI.Document" />
paket add VISEOIberia.AI.Document --version 1.1.7
#r "nuget: VISEOIberia.AI.Document, 1.1.7"
#:package VISEOIberia.AI.Document@1.1.7
#addin nuget:?package=VISEOIberia.AI.Document&version=1.1.7
#tool nuget:?package=VISEOIberia.AI.Document&version=1.1.7
<p align="center"> <img src="https://raw.githubusercontent.com/viseoiberia/viseoiberia.ai.document/main/icon.png" alt="Logo" width="200"/> </p>
Document Analyzer
What is document analyzer?
Document Analyzer is a .NET library designed to perform intelligent document processing using Azure OpenAI. It extracts and structures information from each page of a document—text, images, tables, charts, and diagrams by combining OCR capabilities with powerful multimodal AI.
It processes scanned or image-based documents page by page, generating detailed textual and semantic representations, including descriptions for visual elements. The goal is to transform unstructured content into enriched, machine-readable data ready for downstream automation, analytics, or storage.
Ideal for enterprise workflows, Document Analyzer integrates seamlessly via dependency injection and supports advanced customization of prompts and model parameters to suit your specific use case.
Supported framework
- Netstandard 2.0
- NET 9.0
Prerequisites
You must have an Azure OpenAI resource provisioned in your Azure subscription.
Installation
Install the VISEOIberia.AI.Document library for .NET with NuGet:
dotnet add package VISEOIberia.AI.Document
NuGet Install-Package VISEOIberia.AI.Document -Version x.y.z
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="VISEOIberia.AI.Document" Version="x.y.z" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
Quickstart
Dependency Injection
var builder = WebApplication.CreateBuilder(args);
var documentAnalyzerOptions = new DocumentAnalyzerOptions()
{
Identifier = "my-application",
AzureOpenAI = new AzureOpenAIOptions()
{
Endpoint = "https://your-azure-openai-endpoint.openai.azure.com",
Key = "your-azure-openai-key",
Model = "gpt-4o",
Temperature = 0.2f,
MaxOutputTokens = 1000
},
Prompt = new PromptOptions()
{
System = @"
You are an assistant.
Your only task is to act as an advanced OCR for documents.
You must not interpret, translate, summarize, or add any additional information.",
Action = @"
This is an image of a page from a document.
Your task is to extract all visible content exactly as it appears, preserving the original order and flow.
You must preserve the original language of the document.
Do not translate, interpret, or summarize any content.
Extract all text like an OCR, line by line, in the same reading order.
- If there is a **logo**, replace it with: `[Image: brief description of the logo]`
- If there is an **embedded image**, replace it with: `[Image: detailed description of the image]`
- If there is an **illustration**, replace it with: `[Illustration: detailed description of the illustration]`
- If there is a **chart**, replace it with: `[Chart: detailed description of the chart]`
- If there is a **table**, replace it with a Markdown-formatted table at the same position, and add a brief description below it in the format: `[Table: brief description]`
- If there is a **diagram** (flowchart, Gantt, ER, class, sequence, etc.), insert it at that point as Mermaid code, and include a description below in the format: `[Diagram: brief description]`
- If the page contains an *inline form* (blank lines where the user is expected to write), transcribe the surrounding text exactly and then insert an underscored line (e.g., `________`) to represent the space where the user should write.
- If the page contains a *form composed* of small individual boxes (e.g., for single characters or check-boxes), do not attempt to draw the boxes or create a table in Mermaid. Instead, output a simple ordered list of the field labels as they appear."
}
};
builder.Services.AddDocumentAnalyzer(documentAnalyzerOptions);
Usage
public class MyService
{
private IDocumentAnalyzer _documentAnalyzer;
public MyService(IDocumentAnalyzer documentAnalyzer)
{
_documentAnalyzer = documentAnalyzer;
}
public async Task MyMethod()
{
var file = new File()
{
Name = "document",
Extension = "pdf",
Stream = new MemoryStream(File.ReadAllBytes("path/to/your/document.pdf"))
};
var analysis = await _document.Analyzer.AnalyzeAsync(file);
}
}
Response
{
"Title": "Lorem ipsum",
"Pages": [
{
"Number": 1,
"Content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"Status": "Success",
"Costs": {
"InputTokens": 150,
"OutputTokens": 120
}
},
{
"Number": 2,
"Content": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"Status": "Success",
"Costs": {
"InputTokens": 200,
"OutputTokens": 180
}
},
{
"Number": 3,
"Content": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"Status": "Success",
"Costs": {
"InputTokens": 200,
"OutputTokens": 180
}
}
]
}
Troubleshooting
Common Issues
- Authentication Errors: Check that your API key environment variables are correctly set
- Model Availability: Verify your Azure OpenAI deployment or OpenAI model access
Contribute
One of the easiest ways to participate is to engage in discussions in the GitHub repository. Bug reports and fixes are welcome!
For new features, components, or extensions, please open an issue and discuss with us before sending a PR. This is to avoid rejection as we might be taking the core in a different direction, but also to consider the impact on the larger ecosystem.
To learn more and get started:
- Ask questions in the GitHub discussions
Contributors
License
This project is licensed under the MIT License.
Copyright (c) VISEO Iberia. All rights reserved.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.AI.OpenAI (>= 2.1.0)
- Azure.Identity (>= 1.14.2)
- Docnet.Core (>= 2.6.0)
- Ensure.That (>= 10.1.0)
- Microsoft.Extensions.Http (>= 9.0.7)
- Microsoft.Extensions.Http.Polly (>= 9.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
- SixLabors.ImageSharp (>= 2.1.10)
- ViseoIberia.AI.Pricing.Token (>= 1.1.4)
-
net8.0
- Azure.AI.OpenAI (>= 2.1.0)
- Azure.Identity (>= 1.14.2)
- Docnet.Core (>= 2.6.0)
- Ensure.That (>= 10.1.0)
- Microsoft.Extensions.Http (>= 9.0.7)
- Microsoft.Extensions.Http.Polly (>= 9.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
- SixLabors.ImageSharp (>= 3.1.10)
- ViseoIberia.AI.Pricing.Token (>= 1.1.4)
-
net9.0
- Azure.AI.OpenAI (>= 2.1.0)
- Azure.Identity (>= 1.14.2)
- Docnet.Core (>= 2.6.0)
- Ensure.That (>= 10.1.0)
- Microsoft.Extensions.Http (>= 9.0.7)
- Microsoft.Extensions.Http.Polly (>= 9.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
- SixLabors.ImageSharp (>= 3.1.10)
- ViseoIberia.AI.Pricing.Token (>= 1.1.4)
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.1.7 | 511 | 7/22/2025 |
1.1.6 | 83 | 7/18/2025 |
1.1.5 | 100 | 7/12/2025 |
1.1.4 | 150 | 7/9/2025 |
1.1.3 | 144 | 7/3/2025 |
1.1.2 | 132 | 6/26/2025 |
1.1.1 | 131 | 6/26/2025 |
1.1.0 | 143 | 6/25/2025 |
1.0.7 | 154 | 6/25/2025 |
1.0.6 | 148 | 6/24/2025 |
1.0.5 | 143 | 6/24/2025 |
1.0.4 | 143 | 6/23/2025 |
1.0.3 | 153 | 6/17/2025 |
1.0.2 | 151 | 5/29/2025 |
1.0.1 | 146 | 5/29/2025 |
1.0.0 | 151 | 5/29/2025 |