Faktura till text för .NET

Introduktion till faktura till text för .NET

Invoice to Text for .NET är en plugin som gör det möjligt för utvecklare att extrahera text från fakturor och konvertera dem till redigerbara format. Denna guide kommer att gå igenom de tillgängliga funktionerna, hur man börjar och ge kodexempel i C#.

Stödda filformat

Plugin stöder utvinning av text från olika bild- och dokumentfilerformat, inklusive:

  • JPEG
  • PNG
  • GIF
  • BMP
  • TIFF

Ta ut text från fakturor

För att extrahera text från en faktura kan du använda följande kodexempel:

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source1.png");
input.Add("source2.jpg");
// Set recognition language
Aspose.OCR.InvoiceRecognitionSettings recognitionSettings = new Aspose.OCR.InvoiceRecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Latin;
// Recognize image
List<Aspose.OCR.RecognitionResult> results = recognitionEngine.RecognizeInvoice(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
    Console.WriteLine(result.RecognitionText);
}
//save as a file
results[0].Save("result.txt", Aspose.OCR.SaveFormat.Text);
//or
Aspose.OCR.AsposeOcr.SaveMultipageDocument("result.pdf", Aspose.OCR.SaveFormat.Pdf, results);

API referens

För mer information om tillgängliga klasser, metoder och egenskaper, vänligen hänvisa till API referensdokumentation .

 Svenska