←Select platform

WriteElementsToString Method

Summary
Converts an array of IAnnBatesElement elements to a string expression using (starting, ending , and separating) symbols.
Syntax
C#
C++/CLI
Java
Python
public string WriteElementsToString( 
   IAnnBatesElement[] elements 
) 
public String writeElementsToString(IAnnBatesElement[] elements) 
public:  
   String^ WriteElementsToString( 
      array<IAnnBatesElement^>^ elements 
   ) 
def WriteElementsToString(self,] elements): 

Parameters

elements
The Bates stamp elements array to convert to a string expression. This value must not be null.

Return Value

A string expression for these  elements.

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.