setAnnotations Method

Summary

Replaces the annotations container for this page.

Syntax
TypeScript
JavaScript
DocumentPage.prototype.setAnnotations = function( 
   container 
) 
setAnnotations( 
   container: AnnContainer 
): JQueryPromise<void>; 

Parameters

container

New annotations container to use for this page. This value can be null.

Return Value

A voidPromise object that may resolve successfully.

Remarks

GetAnnotations is used to get the annotations container of this page. All document types support this method.

SetAnnotations is used to replace the annotation container of the page. IsAnnotationsModified is used to as flag that indicates that the annotations container of this page has been replaced by the user.

This method works as follows (the "item" is the new annotations container):

  1. If the value of the IsReadOnly property of LEADDocument is true, then the user cannot modify this document and an exception will be thrown.

  2. Any previously saved annotations container object for this page are purged from the cache.

  3. container is added to the cache by saving it using AnnCodecs. The original object is not deleted. If container is null, then a "null" item is added to the cache.

GetAnnotations will check the cache first, hence, subsequent calls will return the value set by this method.

The value of IsAnnotationsModified will be set to true after this method returns.

Note that you can use DocumentAnnotations.GetAnnotations and DocumentAnnotations.SetAnnotations to get or set an array of annotations container objects for one or more pages with a single call.

Refer to Loading Using LEADTOOLS Document Library for more information.

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