←Select platform

ReadFromString Method

Summary
Reads all Bates stamp elements from the elements' text expression.
Syntax
C#
C++/CLI
Java
Python
public IAnnBatesElement[] ReadFromString( 
   string elementsExpression 
) 
public IAnnBatesElement[] readFromString(String elementsExpression) 
public:  
   array<IAnnBatesElement^>^ ReadFromString( 
      String^ elementsExpression 
   ) 
def ReadFromString(self,elementsExpression): 

Parameters

elementsExpression
A string containing the text expression to be read from the Bates stamp elements. This value must not be null.

Return Value

An array of IAnnBatesElement objects.

Remarks

This method can only load Bates stamp elements previously saved with the same (starting, ending, and separating) symbols for the expression

Example
C#
using Leadtools.Annotations.Engine; 
using Leadtools.Annotations.BatesStamp; 
 
 
public void AnnBatesStampTranslator_AnnBatesStampTranslator() 
{ 
	//Create Bates stamp translator instance 
	AnnBatesStampTranslator translator = new AnnBatesStampTranslator(); 
 
	//Create some Bates stamp elements to test on translator 
	AnnBatesDateTime batesDateTime = new AnnBatesDateTime(); 
	batesDateTime.CurrentDateTime = DateTime.Now; 
 
	AnnBatesNumber batesNumber = new AnnBatesNumber(); 
	batesNumber.AutoIncrement = true; 
	batesNumber.StartNumber = 3; 
	batesNumber.NumberOfDigits = 9; 
	batesNumber.PrefixText = "beforeText"; 
	batesNumber.SuffixText = "afterText"; 
	batesNumber.UseAllDigits = true; 
 
	AnnBatesText batesText = AnnBatesText.Create("This is test"); 
 
	string elementsExpression = translator.WriteElementsToString(new IAnnBatesElement[] { batesDateTime, batesNumber, batesText }); 
 
	//Print the expression  
	Debug.WriteLine(elementsExpression); // the output will be "{{BatesDateTime*Local*}}{{BatesNumber*9*1*3*1*beforeText*afterText}}This is test" 
 
	//Load the Bates stamp elements from the expression again 
	IAnnBatesElement[] elements = translator.ReadFromString(elementsExpression); 
 
	//Print the count of loaded elements to make sure the load is correct 
	Debug.WriteLine(elements.Length); // the output will be "3" 
} 
Requirements

Target Platforms

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

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