- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Leadtools OCR
我引用了以下 DLLS:
Leadtools.dll
Leadtools.Barcode.oneD.dll
Leadtools.codecs.dll
Leadtools.codecs.fax.dll
Leadtools.codecs.png.dll
Leadtools.codecs.tif.dll
Leadtools.Forms.DocumentWriters.dll
Leadtools.forms.ocr.dll
Leadtools.forms.ocr.Advantage.dll
和下面的代码将一个 Png 文件转换为 Pdf
private void button1_Click(object sender, EventArgs e)
{
try
{
string sourceFile = @"C:\Users\cf\Desktop\OcrTest\Images\Capture.PNG";
string targetFile = Path.ChangeExtension(sourceFile, "pdf");
using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false))
{
ocrEngine.Startup(null, null, null, @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime");
ocrEngine.AutoRecognizeManager.Run(sourceFile, targetFile, Leadtools.Forms.DocumentWriters.DocumentFormat.Pdf, null, null);
Process.Start(targetFile);
}
}
catch (OcrSupportLockedException ex)
{
Console.WriteLine("Support is locked. You need to unlock '{0}' in this engine to use this feature", ex.SupportType);
}
catch (OcrException ex)
{
Console.WriteLine("OCR Error\nCode: {0}\nMessage:{1}", ex.Code, ex.Message);
}
catch (RasterException ex)
{
Console.WriteLine("LEADTOOLS Error\nCode: {0}\nMessage:{1}", ex.Code, ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("System Error\nMessage:{0}", ex.Message);
}
}
下一行返回一个OcrException
Ocr Not Enabled
使用代码:-1760
我不知道为什么会这样
任何帮助将不胜感激
最佳答案
错误 -1760“OCR 未启用”很可能是由于在没有适当的许可文件或解锁 key 的情况下尝试使用 LEADTOOLS OCR 引擎之一造成的。您可以在使用 CreateEngine() 之前通过调用 RasterSupport.IsLocked(RasterSupportType.OcrAdvantage) 进行检查。如果函数返回 TRUE,这意味着已锁定,则不应尝试使用 OCR 功能。
要使用 OCR,您需要拥有支持 OCR 的有效工具包许可证,例如 LEADTOOLS Document Imaging Suite,或者拥有有效的免费评估许可证。
启用 OCR 功能的机制取决于工具包版本。如果您已经拥有有效的解锁 key (v17 及更早版本)或有效的许可文件(17.5 及更高版本),但仍然失败,请将该许可/解锁信息发送至 support@leadtools.com,因为您不应发布此类详细信息在公共(public)论坛上。
如果您没有这些详细信息,请将您的工具包序列号发送至 sales@leadtools.com(也不要在此处发布!)您还可以在工作时间使用我们的在线聊天服务联系支持或销售人员。
关于c# - Leadtools - OcrException - ocr 未启用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30389657/
我在以下代码的最后一行遇到异常(对格式感到抱歉,不允许我以任何其他方式发布): LeadHelper.Unlock(); RasterCodecs codecs = new RasterCodecs(
我在 C# 中使用 Lead Tool。并在下面的代码中出错。当我裁剪图像时,我从 JS 传递这个字符串 base64String 值,然后使用 Base64ToImage 函数将它在 c# 中转换为
我正在关注 Leadtools 页面中的下一个示例 https://www.leadtools.com/help/leadtools/v19/dh/co/leadtools.codecs~leadto
在我的 Web 应用程序中,我使用 LeadTools 从流创建多页 Tiff 文件。下面的代码展示了我如何使用 leadtools。 using (RasterCodecs codecs = new
我想将PDF转换为图像。我正在使用Leadtools,并且为了提高速度,我以以下方式使用多线程。 string multiPagePDF = @"Manual.pdf"; string destFil
我正在使用 Leadtools 17.5。如果我将 Leadtools Dll 静态链接到我的 64 位 C++ 应用程序,然后调用 L_SetLicenseBuffer 一切正常,返回值为零。但出于
我想使用 LEADTOOLS iOS SDK 为“GS1 Databar Expanded Stack”代码生成条形码图像,但我找不到执行此操作的正确方法(或任何其他类型的代码)。他们的例子只包含一个
我正在使用 Leadtools OCR 我引用了以下 DLLS: Leadtools.dll Leadtools.Barcode.oneD.dll Leadtools.codecs.dll Leadt
我正在使用 Leadtools SDK 构建一个可以打开和显示 PDF 文件的 C# WPF 应用程序。 在mommet我只有两个要求: 连续滚动(如在 Adobe Reader 中) 放大/缩小
我当前的代码写了一个二维码,但它只用二维码覆盖了我的文件。我不确定如何调整二维码的大小以放置在文档的一个角落而不是占据整个页面。也不确定 RasterImage.Create 是否意味着它创建一个仅包
我想在 dicom 文件中插入虚拟数据而不使用 LEADTOOLS 读取该文件。对于前。我要插入 Patient_Name = xyz etc. 所以任何人都知道使用哪种 LEADTOOLS 方法在
实际上我需要实现 MICR,OCR 代码通过 LeadTools 从 Check in iOS 中读取。但是我无法获得面向初学者的 LeadTools iOS 教程,因此我无法开始实现。请帮助我了解如
我正在使用 C++、LEADTOOLS19 和 VS2015 制作一个 Windows 可执行文件,以从服务器读取图像,使用 LEADTOOLS 对其应用图像效果,然后在浏览器中显示它。 服务器将图像
我已在我的 Maven 项目中添加了 LeadTools 的 jar,并将这些 jar 本地存储在我的 .m2 文件夹中。但在 pom.xml 中,我收到以下错误 - 缺少工件 Leadtools:o
我遇到了这个问题: native 库 Ltkrnx.dll 已加载到另一个类加载器中 在重新部署应用程序期间(tomcat 8 服务器)。 我还添加了检查,但这对我没有帮助。 private void
我正在尝试在 Java 应用程序中使用 Leadtools 的“Forms Recognition and Processing SDK”。我可以毫无问题地创建 RasterCodecs、OcrEng
我想购买从 Leadtools 读取和生成 QR 码的许可证但首先我想试试他们的演示工具。 我正在使用 MSVC 2013 x64 编译器。我想我在文档中做了如下所有事情: 将所有 dll 复制到我的
我正在使用 leadtools 从扫描仪驱动程序获取图像,如何将该图像保存到磁盘(jpg 或 bmp 或任何格式)? 我正在使用这些 dll 文件: - Leadtools.dll - Leadtoo
我正在尝试使用 Leadtools 以了解它对我有何好处,但我对他们关于该过程如何运作的文档感到有点沮丧。我正在创建一个库,其中包含采用输入文件的方法,将其转换为 pdf,将二维码添加到文件并保存,然
我正在尝试使用 Leadtools 以了解它对我有何好处,但我对他们关于该过程如何运作的文档感到有点沮丧。我正在创建一个库,其中包含采用输入文件的方法,将其转换为 pdf,将二维码添加到文件并保存,然
我是一名优秀的程序员,十分优秀!