Рачун за текст за .NET
Увод у рачун у текст за .NET
Invoice to Text for .NET је додатак који омогућава програмерима да извуку текст из рачуна и конвертују их у уређујуће формати. Овај водич ће вас проћи кроз доступне функције, како да почнете, и пружити примере кода у Ц #.
Подржани формати датотека
Плугин подржава екстракцију текста из различитих формата датотека слике и документа, укључујући:
- ЈПЕГ
- ПНГ
- ГИФ
- БМП
- Тифф
Извлачење текста из рачуна
Да бисте извукли текст из рачуна, можете користити следећи пример кода:
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);
АПИ Референце
For more information on the available classes, methods, and properties, please refer to the АПИ референтне документације .