AnnBatesStampComposer is the main part for Bates stamping operation as it connects annotations containers with Bates stamp objects.
public class AnnBatesStampComposerPublic Class AnnBatesStampComposerpublic sealed class AnnBatesStampComposerpublic class AnnBatesStampComposerfunction Leadtools.Annotations.Documents.AnnBatesStampComposer()Use this composer to add target containers to apply Bates stamps to.
It allows the addition of AnnBatesStamp objects. Also this composer have ability to save and load the Bates stamp list.
This example will create Bates stamp object with multiple elements then use the composer to attach the Bates stamp to target container.
Imports LeadtoolsImports Leadtools.Annotations.CoreImports Leadtools.Annotations.AutomationImports Leadtools.Annotations.RenderingImports Leadtools.Annotations.WinFormsImports Leadtools.Annotations.Documents<TestMethod()> _Public Sub AnnBatesStampComposer_AnnBatesStampComposer()'Create AnnBatesStamp and set its propertiesDim batesStamp As AnnBatesStamp = New AnnBatesStamp()batesStamp.Font = New AnnFont("Arial", 12)batesStamp.Foreground = AnnSolidColorBrush.Create("Red")batesStamp.HorizontalAlignment = AnnHorizontalAlignment.CenterbatesStamp.VerticalAlignment = AnnVerticalAlignment.CenterbatesStamp.Logo.Angle = 45batesStamp.Logo.Font = New AnnFont("Arial", 14)batesStamp.Logo.Opacity = 0.5batesStamp.Logo.StretchLogo = TruebatesStamp.Logo.Picture = New AnnPicture(Path.Combine(ImagesPath.Path, "cannon.jpg"))'Add some elements to Bates stamp elements listbatesStamp.Elements.Add(New AnnBatesNumber())batesStamp.Elements.Add(AnnBatesText.Create(" "))batesStamp.Elements.Add(New AnnBatesDateTime())batesStamp.Elements.Add(AnnBatesText.Create(" This is text element"))'Create AnnBatesStampComposer instance and add the created Bates stamp to itDim batesStampComposer As AnnBatesStampComposer = New AnnBatesStampComposer()'Set the rendering engineAnnBatesStampComposer.RenderingEngine = New AnnWinFormsRenderingEngine()batesStampComposer.Stamps.Add(batesStamp)'Use the main automation object for your application instead of _automation we used hereDim automation As AnnAutomation = _automationDim mainContainer As AnnContainer = automation.Container'Create Bates stamp container, set its size and mapper and attach it to the composerDim batesStampContainer As AnnContainer = New AnnContainer()batesStampContainer.Size = mainContainer.SizebatesStampContainer.Mapper = mainContainer.Mapper.Clone()'Apply Bates Stamp to our containerbatesStampComposer.TargetContainers.Add(batesStampContainer)'insert the Bates stamp container below all other containers in the automationautomation.Containers.Insert(0, batesStampContainer)'print the content of this Bates stampDebug.WriteLine(batesStamp.AsString(batesStampContainer)) ' the output will be "000001 1/1/0001 2:00:00 AM This is text element"'Render the containersautomation.Invalidate(LeadRectD.Empty)End Sub
using Leadtools.Annotations.Core;using Leadtools.Annotations.Automation;using Leadtools.Annotations.Rendering;using Leadtools.Annotations.WinForms;using Leadtools.Annotations.Documents;public void AnnBatesStampComposer_AnnBatesStampComposer(){//Create AnnBatesStamp and set its propertiesAnnBatesStamp batesStamp = new AnnBatesStamp();batesStamp.Font = new AnnFont("Arial", 12);batesStamp.Foreground = AnnSolidColorBrush.Create("Red");batesStamp.HorizontalAlignment = AnnHorizontalAlignment.Center;batesStamp.VerticalAlignment = AnnVerticalAlignment.Center;batesStamp.Logo.Angle = 45;batesStamp.Logo.Font = new AnnFont("Arial", 14);batesStamp.Logo.Opacity = 0.5;batesStamp.Logo.StretchLogo = true;batesStamp.Logo.Picture = new AnnPicture(Path.Combine(ImagesPath.Path, "cannon.jpg"));//Add some elements to Bates stamp elements listbatesStamp.Elements.Add(new AnnBatesNumber());batesStamp.Elements.Add(AnnBatesText.Create(" "));batesStamp.Elements.Add(new AnnBatesDateTime());batesStamp.Elements.Add(AnnBatesText.Create(" This is text element"));//Create AnnBatesStampComposer instance and add the created Bates stamp to itAnnBatesStampComposer batesStampComposer = new AnnBatesStampComposer();//Set the rendering engineAnnBatesStampComposer.RenderingEngine = new AnnWinFormsRenderingEngine();batesStampComposer.Stamps.Add(batesStamp);//Use the main automation object for your application instead of _automation we used hereAnnAutomation automation = _automation;AnnContainer mainContainer = automation.Container;//Create Bates stamp container, set its size and mapper and attach it to the composerAnnContainer batesStampContainer = new AnnContainer();batesStampContainer.Size = mainContainer.Size;batesStampContainer.Mapper = mainContainer.Mapper.Clone();//Apply Bates Stamp to our containerbatesStampComposer.TargetContainers.Add(batesStampContainer);//insert the Bates stamp container below all other containers in the automationautomation.Containers.Insert(0, batesStampContainer);//print the content of this Bates stampDebug.WriteLine(batesStamp.AsString(batesStampContainer)); // the output will be "000001 1/1/0001 2:00:00 AM This is text element"//Render the containersautomation.Invalidate(LeadRectD.Empty);}
|
Products |
Support |
Feedback: AnnBatesStampComposer Class - Leadtools.Annotations.Documents |
Introduction |
Help Version 19.0.2017.3.22
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.