Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 23, 2011 6:07:38 AM(UTC)
golisatishkumar

Groups: Registered
Posts: 1


I am using LeadTools Version 15. I am loading multiple page till to viewer and add annotations in 1st page successfully. If i move to next page i am getting 1st page annotations in next page also.How to solve this problem?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, November 24, 2011 5:23:29 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

If you have two buttons (previous and Next) to show the TIFF file pages, you can handle the annotation objects by using the following code:
+-----------------------+
MemoryStream AnnStream = new MemoryStream();
        
private void PreviousButton_Click(object sender, EventArgs e)
{
Leadtools.Annotations.AnnCodecs annCodecs = new AnnCodecs();
AnnCodecsInformation AnnInformation = new AnnCodecsInformation();
           
           
AnnStream.Seek(0, System.IO.SeekOrigin.Begin);
annCodecs.GetInformation(AnnStream, AnnInformation);
try
{
if (AnnInformation.Pages < rasterImageViewer1.Image.Page)
annCodecs.Save(AnnStream, AutomationAnn.Container, AnnCodecsFormat.Xml, rasterImageViewer1.Image.Page, AnnCodecsSavePageMode.Insert);
else
annCodecs.Save(AnnStream, AutomationAnn.Container, AnnCodecsFormat.Xml, rasterImageViewer1.Image.Page, AnnCodecsSavePageMode.Replace);
}
catch (Exception ex1)
{
}
           
rasterImageViewer1.Image.Page = rasterImageViewer1.Image.Page - 1;
AutomationAnn.Container.Objects.Clear();
try
{
AnnStream.Seek(0, System.IO.SeekOrigin.Begin);
annCodecs.Load(AnnStream, AutomationAnn.Container, rasterImageViewer1.Image.Page);
}
catch (Exception ex2)
{
}
 
}

private void NextButton_Click(object sender, EventArgs e)
{
Leadtools.Annotations.AnnCodecs annCodecs = new AnnCodecs();
AnnCodecsInformation AnnInformation = new AnnCodecsInformation();
           
AnnStream.Seek(0, System.IO.SeekOrigin.Begin);
annCodecs.GetInformation(AnnStream, AnnInformation);
try
{
if (AnnInformation.Pages < rasterImageViewer1.Image.Page)  
annCodecs.Save(AnnStream, AutomationAnn.Container, AnnCodecsFormat.Xml, rasterImageViewer1.Image.Page, AnnCodecsSavePageMode.Insert);
else
annCodecs.Save(AnnStream, AutomationAnn.Container, AnnCodecsFormat.Xml, rasterImageViewer1.Image.Page, AnnCodecsSavePageMode.Replace);
}
catch (Exception ex1)
{
}

rasterImageViewer1.Image.Page = rasterImageViewer1.Image.Page + 1;
AutomationAnn.Container.Objects.Clear();
try
{
AnnStream.Seek(0, System.IO.SeekOrigin.Begin);
annCodecs.Load(AnnStream, AutomationAnn.Container, rasterImageViewer1.Image.Page);
}
catch(Exception ex2)
{
}
}
+-----------------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.088 seconds.