Unique identifier of this document.
public string DocumentId { get; } Public ReadOnly Property DocumentId() As StringGet
public:property String^ DocumentId{String^ get()}
public String getDocumentId()
The unique identifier of this document.
This value is set by the framework when the document is initialized. The ID is important when using the document with the cache system and is the only value needed to re-construct completely the document from the cache. The current implementation of the Document library will pass the document ID as the "regionName" value for all cache operations.
This example will show how to use DocumentId to save a document to the cache and then reload it then delete it from the cache.
using Leadtools;using Leadtools.Codecs;using Leadtools.Document.Writer;using Leadtools.Svg;using LeadtoolsExamples.Common;using Leadtools.Document;using Leadtools.Caching;using Leadtools.Annotations.Engine;using Leadtools.Ocr;using Leadtools.Barcode;using Leadtools.Document.Converter;public static void DocumentIdExample(){var cache = GetCache();var policy = new CacheItemPolicy();policy.AbsoluteExpiration = DateTime.Now + new TimeSpan(0, 0, 10);policy.SlidingExpiration = new TimeSpan(0, 0, 10);var options = new LoadDocumentOptions();options.Cache = cache;options.CachePolicy = policy;string documentId = null;using (var document = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options)){document.AutoDeleteFromCache = false;documentId = document.DocumentId;document.SaveToCache();}var loadFromCacheOptions = new LoadFromCacheOptions();loadFromCacheOptions.Cache = cache;loadFromCacheOptions.DocumentId = documentId;using (var document = DocumentFactory.LoadFromCache(loadFromCacheOptions)){if (null != document){document.AutoDeleteFromCache = true;//will be deleted}}}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Document.WriterImports Leadtools.SvgImports Leadtools.DocumentImports Leadtools.CachingImports Leadtools.Annotations.EngineImports Leadtools.BarcodeImports Leadtools.OcrImports LeadtoolsDocumentExamples.LeadtoolsExamples.CommonImports Leadtools.Document.ConverterPublic Shared Sub DocumentIdExample()Dim cache As ObjectCache = GetCache()Dim policy As CacheItemPolicy = New CacheItemPolicy()policy.AbsoluteExpiration = DateTime.Now + New TimeSpan(0, 0, 10)policy.SlidingExpiration = New TimeSpan(0, 0, 10)Dim options As LoadDocumentOptions = New LoadDocumentOptions()options.CachePolicy = policyoptions.Cache = cacheDim documentId As String = NothingUsing document As LEADDocument = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options)document.AutoDeleteFromCache = FalsedocumentId = document.DocumentIddocument.SaveToCache()End UsingDim loadFromCacheOptions As New LoadFromCacheOptionsloadFromCacheOptions.Cache = cacheloadFromCacheOptions.DocumentId = documentIdUsing document As LEADDocument = DocumentFactory.LoadFromCache(loadFromCacheOptions)If document IsNot Nothing Then'will be deleteddocument.AutoDeleteFromCache = TrueEnd IfEnd UsingEnd Sub
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
