←Select platform

SetText Method

Summary

Replaces the text content for this page.

Syntax
C#
C++/CLI
Java
Python
public void SetText( 
   DocumentPageText text 
) 
public:  
   void SetText( 
      DocumentPageText^ text 
   ) 
public void setText(DocumentPageText text) 
def SetText(self,text): 

Parameters

text

New text content to use for this page. This value can be null.

Remarks

GetText is used to parse the text content of a page. All document types support this method and internally will use the LEADTOOLS SVG or OCR engines to obtain the text from the document.

SetText is used to replace the text content of the page. IsTextModified is used to as flag that indicates that the text of this page has been replaced by the user.

This method works as follows (the "item" is the text content):

  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. All previously saved text objects for this page are purged from the cache.

  4. text is added to the cache by serializing the DocumentPageText object. If text is null, then a "null" item is added to the cache.

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

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

For more information, refer to Parsing Text with the 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.