IronOCR 和 Asprise OCR 之间的比较
当我们谈到OCR时,它指的是光学字符识别。 这个术语通常在商业领域中使用,指的是通过计算机软件将任何基于文本的文档(例如扫描或传真页面)的图像或图形表示转换为可编辑的文字格式或文本可搜索的文档格式的过程。
OCR的缩写代表光学字符识别,是由专门为此目的设计的计算机软件执行的任务。 这种类型的软件会扫描页面并识别上面的任何文本信息,将其转换为数字形式,以便可以进行编辑和数字再现,质量不受损失。
OCR有很多应用,但最常见的用例是将扫描文档转换为可以在数据库中格式化和索引并进行分析的数字文件。
在本文中,我们将比较两种最常用的OCR和PDF文档图像库和应用程序。 这些是:
- Asprise OCR
- IronOCR
1.0 介绍
1.1 Asprise OCR简介与功能
Asprise C# .NET OCR(光学字符识别)和条码识别SDK提供了一个高性能的API库,以便为您的C# .NET应用程序(Windows应用程序、Silverlight、ASP.NET Web服务应用程序、ActiveX控件等)配备从扫描文档中提取文本和条码信息的功能。
您可以将图像(JPEG、PNG、TIFF、PDF等各种格式)转换为可编辑的文档格式(Word、XML、可搜索的PDF等)。 除了Asprise图片扫描SDK(从扫描仪捕捉文档)等其他服务,您可以轻松实现完整的文档管理解决方案。
Asprise OCR的功能
准确的文本识别 使用增强的图像处理和文本检测算法,Asprise OCR可以轻松识别质量较差的难处理文档。 参数可以用来略微偏向于准确性而不是速度。
高速OCR引擎 Asprise OCR使用优化的OCR引擎,在短时间内表现出色的识别性能。 通过多线程和可选的GPU加速可以进一步提高速度。
支持20+种语言 Asprise OCR能识别20多种语言,如英语、西班牙语、法语、德语、意大利语、匈牙利语、芬兰语、瑞典语、罗马尼亚语、波兰语、马来语、阿拉伯语、印尼语和俄语。
所有常见的条码格式 支持所有常见的条码格式:EAN-8、EAN-13、UPC-A、UPC-E、ISBN-10、ISBN-13、交叉25码、Code 39、Code 128、PDF417和QR码。
图像到可搜索的PDF 只需几行代码,您就可以将JPEG、PNG、TIFF和PDF等各种格式的图像转换为可搜索的PDF文件。
轻松部署 不需要软件保护加密狗,也不需要许可服务器。 Asprise OCR SDK的部署就像您使用它进行开发一样简单。
预算友好,免版税 免版税意味着您在订购开发许可证时付费,但在将软件部署到数千台服务器或数千名终端用户时不再需要付费。
屡获殊荣的支持 他们的团队不仅友好,而且能够给您提供一流的技术支持。
1.2 IronOCR — 简介和特性
IronOCR为那些在.NET应用程序和网站中使用IronOCR for .NET从照片和PDF中读取文本内容的工程师提供软件。 它扫描照片中的文本和条码,支持多种全球语言; 然后它可以将输出作为纯文本或结构化数据提供。 Iron Software的OCR库可以用于MVC、Web、控制台和桌面.NET应用程序。 对于商业部署,提供开发团队的直接支持的许可。
- 使用最新的Tesseract 5引擎,IronOCR可以从任何图片或PDF格式中读取文本、条形码和QR码。 该库可快速为桌面、控制台和网页应用程序添加OCR功能。
- IronOCR支持125种国际语言。 它还支持自定义语言和词汇表。
- IronOCR可以读取超过20种条形码格式和QR码。
- IronOCR支持多页GIF和TIFF图像格式。
- IronOCR为低质量的扫描图像提供校正功能。
- IronOCR支持多线程——它一次执行一个或多个进程。
- IronOCR可以为页面、段落、行、单词、字符等提供结构化数据输出。
- IronOCR支持各种操作系统,例如Windows、Linux、macOS等。
2.0 在Visual Studio中创建新项目
打开Visual Studio软件并进入"文件菜单"。 选择"新建项目",然后选择"控制台应用程序"。

输入项目名称,并在相应的文本框中选择文件路径。 然后,单击创建按钮并选择所需的.NET Framework,如下图所示。

Visual Studio项目现在将为所选应用程序生成结构,如果您选择了控制台、Windows和Web应用程序,它将打开Program.cs文件,您可以在其中输入代码,并构建/运行应用程序。

接下来,我们可以添加库来测试代码。
3.0 安装
3.1 安装Asprise OCR
We can download the Asprise OCR here.
There are two options: install using NuGet or manually download the SDK from asprise.com.
选项1:NuGet PM> Install-Package asprise-ocr-api
首先,创建一个新的Visual C#/Visual Basic Windows窗体应用程序项目或使用现有项目。 With this solution opened, open the NuGet Package Manager Console and type the following command:
Install-Package asprise-ocr-api
一旦完成,您可以通过将以下代码复制到Program.cs(对于C#)来调用OCR演示表单:
using System;
using System.Windows.Forms;
using asprise_ocr_api;
static class Program
{
// Main application entry point
[STAThread]
static void Main()
{
// Enable visual styles and set text rendering mode
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Launch the OCR sample form
Application.Run(new asprise_ocr_api.OcrSampleForm());
}
}using System;
using System.Windows.Forms;
using asprise_ocr_api;
static class Program
{
// Main application entry point
[STAThread]
static void Main()
{
// Enable visual styles and set text rendering mode
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Launch the OCR sample form
Application.Run(new asprise_ocr_api.OcrSampleForm());
}
}Imports System
Imports System.Windows.Forms
Imports asprise_ocr_api
Friend Module Program
' Main application entry point
<STAThread>
Sub Main()
' Enable visual styles and set text rendering mode
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
' Launch the OCR sample form
Application.Run(New asprise_ocr_api.OcrSampleForm())
End Sub
End Module选项2:从Asprise.com下载OCR SDK
Download a copy of the Asprise OCR SDK from www.asprise.com/product/ocr. 只需将其解压缩到一个空文件夹。
Asprise OCR SDK发行版的文件组织如下:
OCR SDK
|--- aocr.dll, aocr_x64.dll [必需的DLL]
|--- sample-projects [.NET API和示例项目]
+--- images [示例图像]导航到sample-projects文件夹并打开解决方案:ocr-samples-vs.sln。 有两个项目:
- asprise-ocr-api:.NET OCR API
- asprise-ocr-api-sample:演示程序
右键单击asprise-ocr-api-sample项目并选择"设为启动项目",然后点击'开始'按钮或按F5,您将看到与所示相同的UI。
3.2 安装IronOCR
IronOCR库可以通过四种方式下载和安装。
这些是:
- 使用Visual Studio
- 使用 Visual Studio 命令行
- 从NuGet网站直接下载
- 从IronPDF网站直接下载
3.2.1 使用Visual Studio
Visual Studio软件提供NuGet包管理器选项直接将包安装到解决方案。 下面的截图显示了如何打开NuGet包管理器。

它提供了一个搜索框,以显示NuGet网站上的包列表。在包管理器中,我们需要搜索关键字IronOCR,如下图所示:

从上图中可以获得相关搜索项的列表。 我们需要选择所需的选项将包安装到解决方案中。
3.2.2 使用Visual Studio命令行
在Visual Studio中,转至工具 -> NuGet包管理器 -> 包管理器控制台
在包管理器控制台标签中输入以下行:
Install-Package IronOcr
接下来,软件包将在当前项目中下载/安装并准备使用。
3.2.3 从NuGet网站直接下载
第三种方法是直接从网站下载NuGet包。
- Navigate to the Link.
- 从右侧菜单中选择下载包选项。
- 双击已下载的包。 它将自动安装。
- 接下来,重新加载解决方案并开始在项目中使用它。
3.2.4 从IronOCR网站直接下载
Click the link here to download the latest package direct from the website. Once downloaded, follow the steps below to add the package to the project.
- 从解决方案窗口右键点击项目。
- 然后,选择参考选项并浏览下载的参考的存放位置。
- 然后,单击确定以添加参考。
4.0 OCR图像
IronOCR和Asprise OCR都具有将图像转换为文本搜索的OCR技术。
4.1 使用Asprise
以下代码演示了Asprise OCR的基本使用。
using System;
using asprise_ocr_api;
class Example
{
static void Main()
{
// Set up OCR engine
AspriseOCR.SetUp();
AspriseOCR ocr = new AspriseOCR();
ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST);
// Recognize text from the given image
string s = ocr.Recognize("C:\\path\\img.jpg", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
// Output the recognized text to the console
Console.WriteLine("OCR Result: " + s);
// Stop the OCR engine
ocr.StopEngine();
}
}using System;
using asprise_ocr_api;
class Example
{
static void Main()
{
// Set up OCR engine
AspriseOCR.SetUp();
AspriseOCR ocr = new AspriseOCR();
ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST);
// Recognize text from the given image
string s = ocr.Recognize("C:\\path\\img.jpg", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
// Output the recognized text to the console
Console.WriteLine("OCR Result: " + s);
// Stop the OCR engine
ocr.StopEngine();
}
}Imports System
Imports asprise_ocr_api
Friend Class Example
Shared Sub Main()
' Set up OCR engine
AspriseOCR.SetUp()
Dim ocr As New AspriseOCR()
ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST)
' Recognize text from the given image
Dim s As String = ocr.Recognize("C:\path\img.jpg", -1, -1, -1, -1, -1, AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT)
' Output the recognized text to the console
Console.WriteLine("OCR Result: " & s)
' Stop the OCR engine
ocr.StopEngine()
End Sub
End ClassAsprise OCR 支持以下图像格式:GIF、PNG、JPEG、TIFF 和 PDF。 在上一节中的示例OCR代码中,输入如下所示:

OCR输出将是纯文本格式:
Asprise OCR和条码识别
高性能,免版税OCR和条码识别在Windows上,
...
ISBN-13,交叉25码,Code 39,Code 128,PDF417和QR码。
[[QR-Code: www.asprise.com]]
[[CODE-128: Asprise]]。最后两行表示条码信息提取。 注意:条形码的格式和内容都用'[[ ]]'对括起来。
4.2 使用IronOCR
using System;
using IronOcr;
class Example
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
// Specify to use Tesseract 5 engine
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create OcrInput to hold the images
using (var Input = new OcrInput())
{
// Add an image to the OcrInput
Input.AddImage(@"3.png");
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
Console.ReadKey();
}
}
}using System;
using IronOcr;
class Example
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
// Specify to use Tesseract 5 engine
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create OcrInput to hold the images
using (var Input = new OcrInput())
{
// Add an image to the OcrInput
Input.AddImage(@"3.png");
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
Console.ReadKey();
}
}
}Imports System
Imports IronOcr
Friend Class Example
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.EnglishBest
' Specify to use Tesseract 5 engine
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
' Create OcrInput to hold the images
Using Input = New OcrInput()
' Add an image to the OcrInput
Input.AddImage("3.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
Console.ReadKey()
End Using
End Sub
End Class上面展示的Tesseract 5 API允许我们将图像文件转换为文本。 我们正在为Iron Tesseract创建一个对象在上面的代码行中。 我们还创建了一个OcrInput对象,允许我们添加一个或多个图片文件。 在使用OcrInput对象方法add时,我们可能需要在代码中提供可用的图片路径。 可以添加任意数量的图像。 之前构建的IronTesseract对象中的Read函数可以用于解析图像文件并将结果提取到OCR结果中。 它可以从图片中提取文本并转换为字符串。
我们还可以使用Tesseract添加多帧图像。 "AddMultiFrameTiff"是对此操作的另一种方法。 Tesseract库读取图像中的每一帧,每一帧被视为一个独立的页面。 过程将读取图像的第一帧,然后继续读取下一帧,依此类推,直到所有图像帧都被扫描。 此方法仅支持TIFF图像格式。

上面的图像是IronOCR结果的输出,它准确地将数据转换为可编辑文本。
5.0 OCR PDF文件
IronOCR和Asprise OCR将PDF文件转换为可编辑文本。 Asprise OCR提供了一系列选项供用户选择,如保存页面、编辑图片、识别页面等。它还提供保存选项,如文本、文档、HTML格式等。IronOCR也允许我们将转换的OCR文件保存为HTML、文本、PDF等。
5.1 使用Asprise OCR
如果您将输出格式设置为OUTPUT_FORMAT_PDF,您需要指定目标PDF输出文件为:
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
"PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true");ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
"PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true");ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF, "PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true")在上面的代码中,属性是以一个字符串指定的,以| (键和值之间用=分隔)。 或者,您可以分别成对指定属性:
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf",
AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, true);ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf",
AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, true);ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF, AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf", AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, True)要使文字不可见或透明,只需将PROP_PDF_OUTPUT_TEXT_VISIBLE设置为"false"。 同时支持普通PDF和PDF/A。 请参阅Asprise OCR属性摘要。 设置输出格式为OUTPUT_FORMAT_RTF。 然后您可以输出能够在大多数文字处理器(Microsoft Word、Libre Office、TextEdit等)中编辑的.rtf文件。
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF,
"PROP_RTF_OUTPUT_FILE=ocr-result.rtf");ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF,
"PROP_RTF_OUTPUT_FILE=ocr-result.rtf");ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF, "PROP_RTF_OUTPUT_FILE=ocr-result.rtf")一旦OCR完成,您可以使用文字处理器查看或编辑RTF文件:

您可以使用以下方法对PDF输入文件执行OCR:

5.2 使用IronOCR
我们还可以使用OCRInput来管理PDF文件。 Iron Tesseract类将读取文档的每一页。 然后将从页面中提取文本。 我们还可以使用名为AddPdf的第二个功能打开受保护的文档,允许我们将PDF添加到我们的文档列表中(如果受保护则输入密码)。 以下代码展示了如何打开密码保护的PDF文档:
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add a password protected PDF
Input.AddPdf("example.pdf", "password");
// Read the PDF document
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add a password protected PDF
Input.AddPdf("example.pdf", "password");
// Read the PDF document
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Add a password protected PDF
Input.AddPdf("example.pdf", "password")
' Read the PDF document
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using我们可以使用AddpdfPage从PDF文档中的某一页读取和提取内容。 只需指定我们要提取文本的页码。 AddPdfPage允许我们从我们指定的多个页面中提取文本。 在IEnumerable<int>中,我们可以轻松指定多个页面。 我们还必须包含文件位置和扩展名。这在以下代码示例中展示:
using IronOcr;
using System.Collections.Generic;
IEnumerable<int> numbers = new List<int> {2, 8, 10};
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Extract single page
Input.AddPdfPage("example.pdf", 10);
// Extract multiple pages
Input.AddPdfPages("example.pdf", numbers);
// Read the pages and extract content
var Result = Ocr.Read(Input);
// Output the recognized text and save to a text file
Console.WriteLine(Result.Text);
Result.SaveAsTextFile("ocrtext.txt");
}using IronOcr;
using System.Collections.Generic;
IEnumerable<int> numbers = new List<int> {2, 8, 10};
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Extract single page
Input.AddPdfPage("example.pdf", 10);
// Extract multiple pages
Input.AddPdfPages("example.pdf", numbers);
// Read the pages and extract content
var Result = Ocr.Read(Input);
// Output the recognized text and save to a text file
Console.WriteLine(Result.Text);
Result.SaveAsTextFile("ocrtext.txt");
}Imports IronOcr
Imports System.Collections.Generic
Private numbers As IEnumerable(Of Integer) = New List(Of Integer) From {2, 8, 10}
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Extract single page
Input.AddPdfPage("example.pdf", 10)
' Extract multiple pages
Input.AddPdfPages("example.pdf", numbers)
' Read the pages and extract content
Dim Result = Ocr.Read(Input)
' Output the recognized text and save to a text file
Console.WriteLine(Result.Text)
Result.SaveAsTextFile("ocrtext.txt")
End Using使用SaveAsTextFile函数,我们可以将结果存储为文本文件,从而允许我们将文件下载到输出目录路径。 此外,我们还可以使用SaveAsHocrFile将文件保存为HTML文件。
6.0 其他功能
6.1 使用Asprise OCR
Asprise OCR有一些附加选项,如绘制文本区域、绘制图片区域、绘制表格区域、绘制识别区域等。这些都帮助用户提高OCR的性能。 该应用程序不仅执行OCR,我们还能够执行如合并PDF、拆分PDF、编辑PDF等操作。
6.2 使用IronOCR
IronOCR具有独特的功能,允许我们从扫描文档中读取条形码和QR码。 下面的代码展示了如何从给定的图像或文档中读取条码。
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
using (var Input = new OcrInput())
{
// Add an image containing a barcode
Input.AddImage("barcode.gif");
// Read the image to recognize text and barcodes
var Result = Ocr.Read(Input);
// Loop through barcodes and output the value
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
}
}using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
using (var Input = new OcrInput())
{
// Add an image containing a barcode
Input.AddImage("barcode.gif");
// Read the image to recognize text and barcodes
var Result = Ocr.Read(Input);
// Loop through barcodes and output the value
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
}
}Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.EnglishBest
Ocr.Configuration.ReadBarCodes = True
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
Using Input = New OcrInput()
' Add an image containing a barcode
Input.AddImage("barcode.gif")
' Read the image to recognize text and barcodes
Dim Result = Ocr.Read(Input)
' Loop through barcodes and output the value
For Each Barcode In Result.Barcodes
Console.WriteLine(Barcode.Value)
Next Barcode
End Using以上是帮助从给定的图像或PDF文档中读取条形码的代码。 它可以从一个页面/图像中读取多个条码。 为了读取条码,IronOCR有一个独特的设置,Ocr.Configuration.ReadBarCodes,这有助于读取条码。 默认值设置为false。
读取输入后,数据将保存到名为OCRResult的对象中。 这有一个名为Barcodes的属性,它将拥有所有可用的条码数据在列表中。通过使用for-each循环,我们可以一个接一个地获取所有条码详细信息。 此外,它将扫描条形码并读取条形码的值—两个操作在一个过程中完成。
它还支持线程选项。 我们可以同时执行多个 OCR 处理,IronOCR 可识别指定区域的内容。
using IronOcr;
using System.Drawing;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Define the area to recognize text
var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Add the document with the specified content area
Input.Add("document.png", ContentArea);
// Perform OCR on the specified region
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
} using IronOcr;
using System.Drawing;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Define the area to recognize text
var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Add the document with the specified content area
Input.Add("document.png", ContentArea);
// Perform OCR on the specified region
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
} Imports IronOcr
Imports System.Drawing
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Define the area to recognize text
Dim ContentArea = New Rectangle() With {
.X = 215,
.Y = 1250,
.Height = 280,
.Width = 1335
}
' Add the document with the specified content area
Input.Add("document.png", ContentArea)
' Perform OCR on the specified region
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using以上是对特定区域执行OCR的示例代码。 我们只需指定图像或PDF中的矩形区域。 IronOCR中的Tesseract引擎帮助我们识别文本。
7.0 IronOCR和Asprise OCR的许可证模型和定价
IronOCR的许可证模型和价格
30天退款保证:当购买许可证时,如果许可证无法工作,您将获得30天的退款。
易于集成:IronOCR与项目和环境的集成非常简单,我们只需编写一行代码并从NuGet软件包中添加即可。 或者,我们可以从Web下载并以这种方式集成到我们的环境。
永久许可:每个许可证购买一次,不需要续订。
免费支持和产品更新:每个许可证都附带一年免费的产品更新和产品团队的支持。 可以随时购买扩展。 扩展可以查看。
即时许可:在收到付款后立即发出注册许可证密钥。
所有许可证都是永久性的,适用于开发、临时和生产环境。
Lite许可证:
- 1名开发人员
- 1个地点
- 1个项目
- 永久许可证
此套餐允许一个组织中的单个软件开发人员在一个地方使用Iron Software。 Iron Software 可以在单个网络应用程序、内联网应用程序或桌面软件程序中使用。 许可证是不可转让的,不能在组织或代理/客户关系之外共享。此许可证类型与所有其他许可证类型一样,明确排除所有未在协议中明示授予的权利,未购置额外覆盖的情况下,禁止OEM再分配并以SaaS方式使用Iron Software。
定价:每年起价为$799。
专业许可证:
- 10名开发者
- 10个地点
- 10个项目
- 永久许可证
此套餐允许组织中的预定数量的软件开发人员在最多十个单一地点使用Iron Software。 Iron Software 可以用于尽可能多的网站、内联网应用程序或桌面软件应用程序中。许可证不可转让,不能在组织外部或代理/客户关系中共享。此许可证类型与所有其他许可证类型一样,明确排除在协议中未明确授予的所有权利,包括未经购买额外覆盖范围而进行的 OEM 重新分发和使用 Iron Software 作为 SaaS。 此许可证可以与单个项目中的最多十个项目集成。
定价:每年起始$999。
无限许可证:
- 无限开发人员
- 无限地点
- 无限项目
- 永久许可证
这允许组织中的无限数量的软件开发者在无限地点使用 Iron Software。 Iron Software 可以用于尽可能多的网站、内联网应用程序或桌面软件应用程序中。许可证不可转让,不能在组织外部或代理/客户关系中共享。此许可证类型与所有其他许可证类型一样,明确排除在协议中未明确授予的所有权利,包括未经购买额外覆盖范围而进行的 OEM 重新分发和使用 Iron Software 作为 SaaS。
定价:每年起始$2,999。
免版税重分发:这允许您将 Iron Software 作为已打包的商业产品的一部分进行分发(无需支付版税),基于基本许可证所涵盖的项目数量。 它允许在基础许可证所涵盖的项目数量基础上,Iron Software在SaaS软件服务中部署。
定价:每年起始$1,599。

Asprise OCR的许可证模型和定价
Lite许可证:
- 无限终端用户
- 识别文本
- 读取1D条码:UPC、EAN、Code39、Code128
- 文本、XML和PDF输出
- 轻松部署
- 仅支持2个操作系统
- 可用席位1个
- 支持:无
定价:每年起始$7998。
标准许可证:
- 无限终端用户
- BMP、GIF、PNG、JPEG、TIFF和PDF输入。
- 识别文本
- 读取1D条码:UPC、EAN、Code39、Code128
- 读取某些2D:仅限QR和Data Matrix
- 文本、XML和PDF输出
- 轻松部署
- 支持:无
定价:每年起始$7,998。
企业许可证:
- 无限终端用户
- BMP、GIF、PNG、JPEG、TIFF和PDF输入。
- 识别文本
- 读取1D条码:UPC、EAN、Code39、Code128
- 2D:QR, PDF 417, Data Matrix & Aztec
- 文本、XML和PDF输出
- 轻松部署
- 多线程,多处理
定价:起价为 $12,998。

IronOCR Lite包括一名开发者套餐及一年支持,费用约$799,而Asprise Lite 包括一名开发者套餐费用为$7998,没有技术支持,具付费技术支持的费用为$6,296。 IronOCR 专业许可证包括10名开发者套餐及一年技术支持,费用为$999,而等效Asprise许可证包括10名开发者套餐的费用为$37,998每年不含技术支持,但包括付费技术发布和更新,及一年支持的费用为$46,999.00。
IronOCR Lite和专业套餐具有SaaS服务或OEM和5年支持选项。 Lite版本,包括一名开发者套餐及5年支持及SaaS和OEM服务,费用为2897美元,而Asprise则具有SaaS或OEM服务及定制支持选项。 IronOCR 专业版包括10名开发者套餐及一年的付费支持和SaaS及OEM服务,费用为3397美元,而Asprise版本的10名开发者套餐不包含一年支持但包含SaaS及OEM服务费用为$59,996。
8.0 总结
IronOCR在.NET Framework上下文中提供Tesseract,简单易用。 它支持多种方式的照片和PDF文档。 它还提供了多个设置来提高Tesseract OCR库的性能。 支持各种语言,以及在一次操作中支持多种语言。 要了解有关Tesseract OCR的更多信息,请访问他们的网站。
Asprise是一款使用人工智能引擎识别图像和PDF文档的软件应用。 它还提供了多种设置来提高OCR过程的性能。 此外,它提供选择多语言的选项。 Asprise在页面转换的使用上确实有一些限制。 不同操作系统的价格也有所不同。
与Asprise相比,IronOCR软件包在许可证和支持方面更好。Asprise OCR具有定制和固定的更昂贵的套餐。IronOCR起价为$799,而Asprise OCR起价为$7994每年,因此我们的产品更具成本效益,同时也提供比Asprise更多的功能。它还支持在单一价格下的多个平台。
那么,您在等什么? 免费试用对所有人开放。 You can obtain the License here and begin straightaway.
常见问题解答
什么是光学字符识别?
光学字符识别(OCR)是一种技术,用于将不同类型的文档(如扫描的纸质文档、PDF 或数字相机拍摄的图像)转换为可编辑和可搜索的数据。像 IronOCR 这样的工具用于通过将文本图像转换为实际的文本数据来执行 OCR。
如何使用 C# 将图像转换为文本?
IronOCR 提供了一种强大的解决方案,用于在 C# 中将图像转换为文本。您可以使用其强大的 OCR 功能来处理图像文件并提取文本,即使是低质量的图像,也可以使用 Tesseract 5 引擎。
IronOCR 支持哪些格式进行 OCR 操作?
IronOCR 支持广泛的格式进行 OCR 操作,包括 JPEG、PNG、GIF、BMP、TIFF 和 PDF。它还可以处理多页文档和受密码保护的 PDF。
如何在我的 C# 项目中安装 IronOCR?
您可以使用 Visual Studio 中的 NuGet 包管理器在您的 C# 项目中安装 IronOCR。或者,您可以使用命令行安装Install-Package IronOCR,或直接从 IronOCR 网站下载。
使用 IronOCR 相对于其他 OCR 库有什么好处?
IronOCR 提供广泛的语言支持,出色的低质量图像性能,以及条形码和 QR 码识别等功能。它提供具有成本效益的许可证并支持多个平台,价格合理,是开发人员的多功能选择。
IronOCR 能处理多页文档吗?
可以,IronOCR 可以高效地处理多页文档,包括 TIFF 和 PDF,从每一页提取文本。这对于处理大型文档或批量处理非常有用。
IronOCR 提供哪些授权选项?
IronOCR 提供灵活、永久的授权选项,包括 Lite、Professional 和 Unlimited 许可。这些许可证是免版税的,支持 SaaS 和 OEM 服务,适合各种部署场景。
IronOCR 如何处理低质量图像文本提取?
IronOCR 通过使用高级的预处理技术在执行 OCR 之前增强图像质量,擅长从低质量的图像中提取文本。这显著提高了文本识别的准确性。






