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 : Friday, August 11, 2017 3:04:49 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 161

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

Here's our documentation page on how to save annotations to a TIFF document:
https://www.leadtools.com/help/leadtools/v19m/dh/an/anncodecs-savetotag.html

There is also an overload to let you save it to multiple pages:

Code:

public RasterTagMetadata SaveToTag(
	AnnContainer container,
	int pageNumber,
	bool saveToWang)


The major difference is the insertion of the second parameter that specifies what page in the TIFF to save the tag to--this means that different AnnContainers can be saved to different pages. Here's a code snippet which demonstrates how to specify the tag, then subsequently embedding those tags in the image.

Code:

      private static void SaveTags(string tiff)
      {
         AnnContainer page1Annotations = new AnnContainer();
         page1Annotations.Children.Add(new AnnRectangleObject(new LeadRectD(100, 100, 100, 100)));

         AnnContainer page2Annotations = new AnnContainer();
         page2Annotations.Children.Add(new AnnRectangleObject(new LeadRectD(200, 200, 100, 100)));

         AnnCodecs ac = new AnnCodecs();
         using (RasterCodecs codecs = new RasterCodecs())
         {
            RasterTagMetadata rtmd1 = ac.SaveToTag(page1Annotations, 1, false);
            RasterTagMetadata rtmd2 = ac.SaveToTag(page2Annotations, 2, false);

            codecs.WriteTag(tiff, 1, rtmd1);
            Console.WriteLine("Wrote a tag containing {0} annotations to page 1", page1Annotations.Children.Count);

            codecs.WriteTag(tiff, 2, rtmd2);
            Console.WriteLine("Wrote a tag containing {0} annotations to page 2", page2Annotations.Children.Count);
         }
      }


This functionality is only available in the latest version of the LEADTOOLS SDK, which can be accessed on our downloads page.
https://www.leadtools.com/downloads?category=main
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

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.

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.030 seconds.