←Select platform

Save(Stream,AnnBatesStampComposer) Method

Summary
Saves a Bates stamp composer with its components to a stream.
Syntax
C#
C++/CLI
Java
Python
public static void Save( 
   Stream stream, 
   AnnBatesStampComposer composer 
) 
public static void save(OutputStream stream, AnnBatesStampComposer composer) 
public:  
   static void Save( 
      Stream^ stream, 
      AnnBatesStampComposer^ composer 
   ) 
def Save(self,stream,composer): 

Parameters

stream
Destination stream to save the data to.

composer
The AnnBatesStampComposer to be saved. This value must not be null.

Example
C#
using Leadtools.Annotations.Engine; 
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Rendering; 
using Leadtools.Annotations.WinForms; 
using Leadtools.Annotations.BatesStamp; 
 
public void AnnBatesStampComposer_SaveLoad() 
{ 
	//Create Bates stamp object to be used on our test 
	AnnBatesStamp batesStamp = new AnnBatesStamp(); 
	batesStamp.Elements.Add(new AnnBatesNumber()); 
 
	//Create Bates stamp composer that we want to save and load 
	AnnBatesStampComposer composer = new AnnBatesStampComposer(); 
	//Create new container and attach it to the Bates stamp composer to stamp it. 
	AnnContainer batesStampContainer = new AnnContainer(); 
	composer.TargetContainers.Add(batesStampContainer); 
	composer.Stamps.Add(batesStamp); 
 
	//Print the contents of Bates stamp object 
	Debug.WriteLine(composer.Stamps[0].AsString(batesStampContainer)); // the output will be "000001" 
 
 
	//temp file to save on , if the file is not existing , it will be created on specfied path 
	string tempFile = Path.Combine(LEAD_VARS.ImagesDir, "temp.xml"); 
 
	//Save the composer to the temp file then load it again 
	AnnBatesStampComposer.Save(tempFile, composer); 
 
	AnnBatesStampComposer loadedComposer = AnnBatesStampComposer.Load(tempFile); 
	loadedComposer.TargetContainers.Add(batesStampContainer); 
 
	//Print the contents of Bates stamp object again to make sure the load is correct. 
	Debug.WriteLine(loadedComposer.Stamps[0].AsString(batesStampContainer)); // the output will be "000001" 
} 
 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
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.Annotations.BatesStamp Assembly

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