←Select platform

SaveToString Method

Summary

Saves a Bates stamp composer to a string.

Syntax

C#
VB
Java
WinRT C#
C++
public static string SaveToString( 
   AnnBatesStampComposer composer 
) 
Public Shared Function SaveToString( _ 
   ByVal composer As Leadtools.Annotations.Documents.AnnBatesStampComposer _ 
) As String 
public static String saveToString(AnnBatesStampComposer composer) 
             
 function Leadtools.Annotations.Documents.AnnBatesStampComposer.SaveToString(  
   composer  
) 
public:  
   static String^ SaveToString( 
      AnnBatesStampComposer^ composer 
   ) 

Parameters

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

Example

This example will create Bates stamp composer , save it to string and load it from string again.

C#
VB
using Leadtools.Annotations.Core; 
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Rendering; 
using Leadtools.Annotations.WinForms; 
using Leadtools.Annotations.Documents; 
using LeadtoolsExamples.Common; 
 
public void AnnBatesStampComposer_SaveLoadToFromString() 
{ 
   //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" 
 
   //Save the composer to string then load it again 
   string savedString = AnnBatesStampComposer.SaveToString(composer); 
 
   AnnBatesStampComposer loadedComposer = AnnBatesStampComposer.LoadFromString(savedString); 
   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" 
} 
Imports Leadtools 
Imports Leadtools.Annotations.Core 
Imports Leadtools.Annotations.Automation 
Imports Leadtools.Annotations.Rendering 
Imports Leadtools.Annotations.WinForms 
Imports Leadtools.Annotations.Documents 
Imports LeadtoolsExamples.Common 
 
Public Sub AnnBatesStampComposer_SaveLoadToFromString() 
   'Create Bates stamp object to be used on our test 
   Dim batesStamp As AnnBatesStamp = New AnnBatesStamp() 
   batesStamp.Elements.Add(New AnnBatesNumber()) 
 
   'Create Bates stamp composer that we want to save and load 
   Dim composer As AnnBatesStampComposer = New AnnBatesStampComposer() 
   'Create new container and attach it to the Bates stamp composer to stamp it. 
   Dim batesStampContainer As AnnContainer = 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" 
 
   'Save the composer to string then load it again 
   Dim savedString As String = AnnBatesStampComposer.SaveToString(composer) 
 
   Dim loadedComposer As AnnBatesStampComposer = AnnBatesStampComposer.LoadFromString(savedString) 
   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" 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Documents Assembly