Spanish OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Outras versões deste documento:

O IronOCR é um componente de software em C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o espanhol.

Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET e que supera regularmente outros mecanismos do Tesseract em termos de velocidade e precisão.

Conteúdo de IronOcr.Idiomas.Espanhol

Este pacote contém diversas opções de idioma OCR for .NET:

  • Espanhol
  • Melhor em espanhol
  • EspanholRápido
  • Espanhol Antigo
  • EspanholAntigoMelhor
  • EspanholVelhoRápido

Baixar

Pacote de idioma espanhol [español]

Instalação

A primeira coisa que precisamos fazer é instalar nosso pacote de OCR em espanhol no seu projeto .NET.

Install-Package IronOcr.Languages.Spanish

Exemplo de código

Este exemplo de código C# lê texto em espanhol de uma imagem ou documento PDF.

// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

// Set the OCR language to Spanish
Ocr.Language = OcrLanguage.Spanish;

// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all text from the OCR result
    var AllText = Result.Text;

    // The 'AllText' variable now contains the Spanish text
}
// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

// Set the OCR language to Spanish
Ocr.Language = OcrLanguage.Spanish;

// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all text from the OCR result
    var AllText = Result.Text;

    // The 'AllText' variable now contains the Spanish text
}
$vbLabelText   $csharpLabel

O código acima demonstra como utilizar a biblioteca IronOCR para ler e extrair texto em espanhol de um arquivo de imagem chamado Spanish.png. Certifique-se de incluir os namespaces necessários e de gerenciar os recursos adequadamente usando blocos <script> quando necessário.