←Select platform

SetAnnotations Method

Summary

Replaces the annotation container for this page.

Syntax
C#
C++/CLI
Java
Python
public void SetAnnotations( 
   AnnContainer container 
) 
public:  
   void SetAnnotations( 
      AnnContainer^ container 
   ) 
public void setAnnotations(AnnContainer container) 
def SetAnnotations(self,container): 

Parameters

container

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

Remarks

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

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

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

  1. This method requires that the owner document uses a cache system (LEADDocument.HasCache is true); otherwise, an exception will be thrown.

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

  3. Any previously saved annotation container object for this page is purged from the cache.

  4. A 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. 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 annotation container objects for one or more pages with a single call.

For more information, refer to Loading Using LEADTOOLS Document Library.

Requirements

Target Platforms

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

Leadtools.Document Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.