Files
fil/docs/snippets/csharp/ocr/ocr_easyocr.md
Henrik Jess Nielsen b4c07d3693
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s
Nomad changes
2026-06-01 23:40:55 +02:00

24 lines
662 B
Markdown

```csharp title="C#"
using Kreuzberg;
var config = new ExtractionConfig
{
Ocr = new OcrConfig
{
Backend = "easyocr",
Language = "en"
}
};
// EasyOCR-specific options (use_gpu, beam_width, etc.) can be passed through
// OcrConfig's EasyocrConfig field if available, or via backend-specific configuration.
var result = KreuzbergLib.ExtractFileSync("scanned.pdf", null, config);
string content = result.Content;
string preview = content.Length > 100 ? content[..100] : content;
int totalLength = content.Length;
Console.WriteLine($"Extracted content (preview): {preview}");
Console.WriteLine($"Total characters: {totalLength}");
```