Exporting Images of OCR Elements
This example show how IronTesseract
can extract the Image and coordinates for every character, word, line, or paragraph of text in any OCR document.
using IronOcr; using IronSoftware.Drawing; var ocrTesseract = new IronTesseract(); using var ocrInput = new OcrInput(); ocrInput.LoadImage(@"images\image.png"); var ocrResult = ocrTesseract.Read(ocrInput); foreach (var page in ocrResult.Pages) { foreach (var word in page.Words) { word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png); } }
Imports IronOcr Imports IronSoftware.Drawing Private ocrTesseract = New IronTesseract() Private ocrInput = New OcrInput() ocrInput.LoadImage("images\image.png") Dim ocrResult = ocrTesseract.Read(ocrInput) For Each page In ocrResult.Pages For Each word In page.Words word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png) Next word Next page
Install-Package IronOcr
This example show how IronTesseract
can extract the Image and coordinates for every character, word, line, or paragraph of text in any OCR document.
9 .NET API products for your office documents