[SerializableAttribute()][DataContractAttribute()]public class AltoXmlDocumentOptions : DocumentOptions
<DataContractAttribute()><SerializableAttribute()>Public Class AltoXmlDocumentOptionsInherits DocumentOptions
@interface LTAltoXmlDocumentOptions : LTDocumentOptions <NSCopying, NSCoding> public class AltoXmlDocumentOptions extends DocumentOptions [DataContractAttribute()][SerializableAttribute()]public ref class AltoXmlDocumentOptions : public DocumentOptions
The options set in the AltoXmlDocumentOptions class will be used when the user saves a document using the DocumentFormat.AltoXml format.
To change the options used with the Alto format, perform the following steps:
Note that this format does not support calling DocumentWriter.InsertPage.
This example will create a new text file using some of the supported options.
using Leadtools.Document.Writer;using Leadtools;using Leadtools.Codecs;using Leadtools.Ocr;public void AltoXmlDocumentOptionsExample(){var inputFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif");var outputFileName = Path.Combine(LEAD_VARS.ImagesDir, "Example.xml");// Setup LEADTOOLS OCR engineusing (var ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)){ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir);// Get the DocumentWriter instancevar docWriter = new DocumentWriter();// Change the ALTO XML optionsvar altoXmlOptions = docWriter.GetOptions(DocumentFormat.AltoXml) as AltoXmlDocumentOptions;altoXmlOptions.FileName = inputFileName;altoXmlOptions.SoftwareCreator = "LEAD";docWriter.SetOptions(DocumentFormat.AltoXml, altoXmlOptions);// Create a documentusing (var ocrDocument = ocrEngine.DocumentManager.CreateDocument()){// Add the imagevar ocrPage = ocrDocument.Pages.AddPage(inputFileName, null);// Recognize itocrPage.Recognize(null);// Save the document as ALTO XMLocrDocument.Save(outputFileName, DocumentFormat.AltoXml, null);}}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS21\Bin\Common\OcrLEADRuntime";}
Imports Leadtools.Document.WriterImports LeadtoolsImports Leadtools.CodecsImports Leadtools.OcrPublic Sub AltoXmlDocumentOptionsExample()Dim inputFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif")Dim outputFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Example.xml")' Setup LEADTOOLS OCR engineUsing ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrLEADRuntimeDir)' Get the DocumentWriter instanceDim docWriter As New DocumentWriter()' Change the ALTO XML optionsDim altoXmlOptions As AltoXmlDocumentOptions = DirectCast(docWriter.GetOptions(DocumentFormat.AltoXml), AltoXmlDocumentOptions)altoXmlOptions.FileName = inputFileNamealtoXmlOptions.SoftwareCreator = "LEAD"docWriter.SetOptions(DocumentFormat.AltoXml, altoXmlOptions)' Create a documentUsing ocrDocument As IOcrDocument = ocrEngine.DocumentManager.CreateDocument()' Add the imageDim ocrPage As IOcrPage = ocrDocument.Pages.AddPage(inputFileName, Nothing)' Recognize itocrPage.Recognize(Nothing)' Save the document as ALTO XMLocrDocument.Save(outputFileName, DocumentFormat.AltoXml, Nothing)End UsingEnd UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"Public Const OcrLEADRuntimeDir As String = "C:\LEADTOOLS21\Bin\Common\OcrLEADRuntime"End Class
AltoXmlDocumentOptions Members
Leadtools.Document.Writer Namespace
Programming with LEADTOOLS Document Writers
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
