[SerializableAttribute ()]
[DataContractAttribute ()]
公共类AltoXmlDocumentOptions:DocumentOptions
< DataContractAttribute () >
< SerializableAttribute () >
公共类AltoXmlDocumentOptions
继承了DocumentOptions
@接口LTAltoXmlDocumentOptions: LTDocumentOptions
公共类AltoXmlDocumentOptions扩展DocumentOptions
[DataContractAttribute ()]
[SerializableAttribute ()]
公共ref类AltoXmlDocumentOptions:公共DocumentOptions
属性中设置的选项AltoXmlDocumentOptions类保存文档时,将使用DocumentFormat。AltoXml格式。
修改Alto格式的选项,请执行以下步骤:
注意,这种格式不支持调用DocumentWriter。InsertPage.
这个例子将使用一些受支持的选项创建一个新的文本文件。
使用Leadtools.Document.Writer;
使用Leadtools;
使用Leadtools.Codecs;
使用Leadtools.Ocr;
公共无效AltoXmlDocumentOptionsExample ()
{
varinputFileName = Path.Combine(LEAD_VARS.ImagesDir,“ocr1.tif”);
varoutputFileName = Path.Combine(LEAD_VARS.ImagesDir,“Example.xml”);
//设置LEADTOOLS OCR引擎
使用(varocrEngine = OcrEngineManager.CreateEngine(ocrengintype . lead))
{
ocrEngine。启动(零,零,零, LEAD_VARS.OcrLEADRuntimeDir);
//获取DocumentWriter实例
vardocWriter =新DocumentWriter ();
//修改ALTO XML选项
varaltoXmlOptions = docWriter.GetOptions(DocumentFormat.AltoXml)作为AltoXmlDocumentOptions;
altoXmlOptions。文件名= inputFileName;
altoXmlOptions。SoftwareCreator =“领导”;
docWriter.SetOptions (DocumentFormat。AltoXml altoXmlOptions);
//创建一个文档
使用(varocrDocument = ocreengine . documentmanager . createdocument ())
{
//添加图像
varocrPage = ocrDocument.Pages.AddPage(inputFileName,零);
//识别
ocrPage。识别(零);
//保存为ALTO XML
ocrDocument。保存(outputFileName DocumentFormat。AltoXml,零);
}
}
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
公共常量字符串OcrLEADRuntimeDir =@“C: \ LEADTOOLS21 \ Bin \常见\ OcrLEADRuntime”;
}
进口Leadtools.Document.Writer
进口Leadtools
进口Leadtools。编解码器
进口Leadtools。光学字符识别
公共子AltoXmlDocumentOptionsExample ()
昏暗的inputFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“ocr1.tif”)
昏暗的outputFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Example.xml”)
'设置LEADTOOLS OCR引擎
使用ocrEngine作为IOcrEngine = OcrEngineManager.CreateEngine(ocrengintype . lead)
ocrEngine。启动(没有什么,没有什么,没有什么LEAD_VARS.OcrLEADRuntimeDir)
获取DocumentWriter实例
昏暗的docWriter作为新DocumentWriter ()
“更改ALTO XML选项
昏暗的altoXmlOptions作为AltoXmlDocumentOptions =DirectCast(docWriter.GetOptions (DocumentFormat.AltoXml)、AltoXmlDocumentOptions)
altoXmlOptions。FileName = inputFileName
altoXmlOptions。SoftwareCreator =“领导”
docWriter.SetOptions (DocumentFormat。AltoXml altoXmlOptions)
创建一个文档
使用ocrDocument作为IOcrDocument = ocreengine . documentmanager . createdocument ()
添加图片
昏暗的ocrPage作为IOcrPage = ocrDocument.Pages.AddPage(inputFileName,没有什么)
承认它
ocrPage。识别(没有什么)
将文档保存为ALTO XML
ocrDocument。保存(outputFileName DocumentFormat。AltoXml,没有什么)
结束使用
结束使用
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
公共常量OcrLEADRuntimeDir作为字符串=“C: \ LEADTOOLS21 \ Bin \常见\ OcrLEADRuntime”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗网络查看器net
188宝金博怎么下载
支持的平台上
.NET、Java、Android和iOS/macOS程序集
C API/ c++类库
HTML5 JavaScript库
您的邮件已发送给技术支持!应该有人联系!如果你的事情很紧急,请回来聊天。
聊天时间:
周一至周五,美国东部时间上午8:30至下午6:00
感谢您的反馈!
请再次填写表格,开始新的聊天。
所有代理目前都离线。
聊天时间:
星期一至星期五
美国东部时间上午8:30 -下午6点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。