←Select platform

Descriptor Property

Summary

The JSON serializable object that describes a document.

Syntax
C#
VB
C++
Java
public DocumentDescriptor Descriptor { get; set; } 
Public Property Descriptor() As DocumentDescriptor 
   Get 
   Set 
public:  
   property DocumentDescriptor^ Descriptor 
   { 
      DocumentDescriptor^ get() 
      void set(DocumentDescriptor^ value) 
   } 
public DocumentDescriptor getDescriptor() 
public void setDescriptor(DocumentDescriptor value) 

Property Value

JSON serializable object that describes a document.

Remarks

DocumentDescriptor is a class that holds JSON data that describes a document. This data can be obtained from any document using LEADDocument.CreateDocumentDescriptor and the document can then be disposed. At a later time, DocumentFactory.Create can be called with this descriptor object set in CreateDocumentOptions.Descriptor to regenerate the original document. LEADDocument.UpdateFromDocumentDescriptor can be used to update an existing document from a descriptor.

This technique is used by LEADTOOLS Document Web Service as follows:

  1. The user creates a new document using JavaScript.

  2. The document is manipulated at the JavaScript side, for example, pages are added or removed and the document could be set in the document viewer for display

  3. During this whole process, the document exists only on the client side - it is not save to the server cache.

  4. When ready, the user calls DocumentFactory.saveToCache from the JavaScript code. Here, the JavaScript toolkit library will create a DocumentDescriptor object and send it to the Documents service method SaveToCache

  5. The service will try first to load the document from the cache, if it does not exist (when this is the first call to save this document), it will then use DocumentFactory.Create with CreateDocumentOptions.Descriptor set to the object passed into the request by JavaScript. If the document exists, then LEADDocument.UpdateFromDocumentDescriptor is called to update the document object from the JavaScript object in case it has changed (subsequent calls to LEADDocument.SaveToCache for this document).

  6. Finally, LEADDocument.SaveToCache is called to save the updated document into the cache

DocumentId is not used if Descriptor is not null. Instead, the document creation data along with its ID is stored in the DocumentDescriptor object set in the method.

Example

For an example, refer to DocumentFactory.Create.

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly