<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Atalasoft Knowledgebase : Annotations : Storage</title><description>Atalasoft Knowledgebase : Annotations : Storage RSS 2.0 Feed</description><link>http://www.atalasoft.com/KB/</link><webMaster>admin@atalasoft.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 08:50:45 GMT</lastBuildDate><ttl>20</ttl><generator>Atalasoft Knowledgebase</generator><item><title>Add annotations to a Pdf without rasterizing</title><link>http://www.atalasoft.com/KB/article.aspx?id=10232</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;DL&gt;&lt;DT&gt;Using our PdfAnnotationDataExporter allows you to export your annotations over your pdf without altering the underlying pdf. This allows you to add annotations over an already searchable pdf and to leave a non-image pdf at its already small file size. Here is a snippit of code that uses the exporter on a pdf:&lt;/DT&gt;&lt;/DL&gt;&lt;P&gt;&lt;HR&gt;&lt;FONT size=3&gt;C#&lt;BR&gt;&lt;HR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: green"&gt;//Best practices is to encode our PDF first and then export the annos over the top.&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: green"&gt;//If you haven't created your PDF yet, do so now. If you're annotating over an existing PDF, acquire a Stream to it.&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; saveDoc = &lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt;.Null; &lt;SPAN style="COLOR: green"&gt;//This will be our stream that contains the PDF. Can be any kind of seekable stream.&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: green"&gt;//Just make sure you don't leave it as Stream.Null.&lt;/SPAN&gt;&lt;BR&gt;    saveDoc.Position = 0;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: green"&gt;//Get our generated pagecount. Note: we're resetting our filestream position after each access.&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; pageCount = &lt;SPAN style="COLOR: #2b91af"&gt;RegisteredDecoders&lt;/SPAN&gt;.GetImageInfo(saveDoc).FrameCount;&lt;BR&gt;    saveDoc.Position = 0;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #2b91af"&gt;SizeF&lt;/SPAN&gt;[] sizes =&amp;nbsp</description><pubDate>Wed, 15 May 2013 09:44:00 GMT</pubDate><dc:creator>Stewart Basler-Francis</dc:creator></item><item><title>Transparent Highlight Annotations in PDF</title><link>http://www.atalasoft.com/KB/article.aspx?id=10334</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;Some annotation features offered by AnnotationUI objects may be incompatible with particular image formats. A translucent RectangleAnnotation embedded in a PDF, for instance, renders as an opaque annotation in most PDF viewing applications.&lt;/P&gt;&lt;P&gt;We can sometimes get around limitations like this by substituting incompatible annotations with annotations that support more of the desired features. The code below demonstrates how to convert all the translucent RectangleAnnotations in a LayerCollection into a suitable PdfMarkupAnnotation with similar properties.&lt;/P&gt;&lt;P&gt;public static AnnotationDataCollection ConvertForPdfExport(LayerCollection origLayers)&lt;BR&gt;{&lt;BR&gt;    AnnotationDataCollection annotationData = new AnnotationDataCollection();&lt;BR&gt;&lt;BR&gt;    foreach (LayerAnnotation layer in origLayers)&lt;BR&gt;    {&lt;BR&gt;        LayerAnnotation convertedLayer = new LayerAnnotation();&lt;BR&gt;        foreach (AnnotationUI anno in layer.Items)&lt;BR&gt;        {&lt;BR&gt;            if (anno is RectangleAnnotation)&lt;BR&gt;            {&lt;BR&gt;                RectangleAnnotation rectangleAnno = anno as RectangleAnnotation;&lt;BR&gt;                if (rectangleAnno != null &amp;amp;&amp;amp; rectangleAnno.Translucent)&lt;BR&gt;                {&lt;BR&gt;                    PdfMarkupAnnotation replacementAnno = new PdfMarkupAnnotation(null, PdfMarkupType.Highlight);&lt;BR&gt;      &amp;</description><pubDate>Wed, 21 Nov 2012 07:05:00 GMT</pubDate><dc:creator>Stewart Basler-Francis</dc:creator></item><item><title>Embed XMP data into a TIFF file.</title><link>http://www.atalasoft.com/KB/article.aspx?id=10220</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;&lt;FONT color=#ff1111&gt;This document is for DotAnnotate 5.0 or higher. Instructions for earlier versions can be found at &lt;A href="http://www.atalasoft.com/KB/article.aspx?id=10111"&gt;http://www.atalasoft.com/KB/article.aspx?id=10111&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;XMP annotation data can be embedded into a TIFF file rather than saving it as a separate file.  This is done by saving the annotations into an XMP packet with the &lt;STRONG&gt;XmpFormatter&lt;/STRONG&gt; and embedding the data into the XMP TIFF tag.  Below is a code example:&lt;/P&gt;&lt;PRE style="white-space: pre;"&gt;[C#]using Atalasoft.Annotate;using Atalasoft.Annotate.UI;using Atalasoft.Annotate.Formatters;using Atalasoft.Imaging;using Atalasoft.Imaging.Codec;using System.IO;//...private void SaveXmpToTiff(Stream outputStream, AnnotateViewer viewer){  SaveXmpToTiff(outputStream, viewer.Annotations, viewer.Image);}private void SaveXmpToTiff(Stream outputStream, AnnotationController controller, AtalaImage image){  // Create an XmpFormatter and tell it to create a packet.  // Packets are required when embedding the data into an image.  XmpFormatter formatter = new XmpFormatter();  formatter.CreateXmpPacket = true;&lt;BR&gt;  // Create a TiffEncoder and set its Xmp property to the annotation data.  TiffEncoder tif = new TiffEncoder();  tif.Xmp = controller.Save(formatter);&lt;BR&gt;  // Save the Tiff.  tif.Save(outputStream, image, null);}[VB.NET]Imports Atalasoft.AnnotateImports Atalasoft.Annotate.UIImports Atalasoft.Annotate.FormattersImports Atalasoft.ImagingImports Atalasoft.Imaging.CodecImports System.IO'...Private Sub SaveXmpToTiff(ByVal outputStream As Stream, ByVal viewer As AnnotateViewer)  SaveXmpToTiff(outputStream, viewer.Annotations, viewer.Image)End Sub Private Sub SaveXmpToTiff(ByVal outputStream As Stream, ByVal controller As AnnotationController, ByVal image As AtalaImage)  ' Create an XmpFormatter and tell it to create a packet.  ' Packets are requi</description><pubDate>Tue, 13 Mar 2012 06:26:00 GMT</pubDate><dc:creator>Robin Sale</dc:creator></item><item><title>Freehand Annotations Embedded into PDF Don''t Render As Expected</title><link>http://www.atalasoft.com/KB/article.aspx?id=10335</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;When you create various annotations (notably Freehand)in our annotation aware viewers and embed them into PDF files, you would expect that re-opening them in our annotation viewers would have them render the same as they looked when they went in. (In other words, that annotations created in our viewers would properly "Round-trip" to embedded PDF annotations and back).&lt;/P&gt;&lt;P&gt;This happens because by default, when embedding annotations into a PDF using our PDFAnnotationExporter, it tries to only include properties available withing native PDF annotation for the types that you're embedding. This helps to ensure that all PDF readers will see the annotations the same way. However, a side effect is that the embedded annotations no longer contain all settings that were present at creation time. This can lead to annotations that "look wrong" when re-opened as seen in the example images.&lt;/P&gt;&lt;CENTER&gt;&lt;TABLE border=2 cellSpacing=0 cellPadding=5&gt;&lt;TBODY&gt;&lt;TR align=center&gt;&lt;TD&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 173px" border=0 hspace=10 align=left src="http://www.atalasoft.com/KB/Attachments/de02ab05-52ef-467d-b3aa-5473.png" width=400 height=173&gt;&lt;/TD&gt;&lt;TD&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 173px" border=0 hspace=10 align=right src="http://www.atalasoft.com/KB/Attachments/e5e3dce5-98dc-42e6-9837-ad89.png" width=400 height=173&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR align=center&gt;&lt;TD&gt;Annotation You Saved&lt;/TD&gt;&lt;TD&gt;Annotation You See&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;P&gt;&lt;/P&gt;&lt;/TABLE&gt;&lt;/CENTER&gt;&lt;P&gt;You can override this default behavior by setting the PdfAnnotationDataExporter.AlwaysEmbedAnnotationData property to TRUE. &lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this means that some PDF viewers may not render the annotations in exactly the same way, but it will ensure that DotImage does.&lt;BR&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description><pubDate>Tue, 18 Oct 2011 08:56:00 GMT</pubDate><dc:creator>Robin Sale</dc:creator></item><item><title>Autosave Web Text Annotation edits without hiding the editor</title><link>http://www.atalasoft.com/KB/article.aspx?id=10327</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;Problem: User edits text and does not hide the editor by clicking off the annotation.  The text then does not persist on the server when a RemoteInvoke is done (like saving the annotations to a file or database).&lt;/P&gt;&lt;P&gt;Solution: Keep track of text changes and force the annotation to update after a period of inactivity.  In this example, we'll update after 1 second.&lt;/P&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;FONT face="Century Schoolbook"&gt;&lt;P&gt;Atalasoft.Utils.InitClientScript(myPageLoad);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;P&gt;function&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt; myPageLoad() {&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P&gt;WebAnnotationViewer1.AnnotationEditorShown = OnEditorShown;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;P&gt;function&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt; OnEditorShown(e) {&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt; (e.annotation &amp;amp;&amp;amp; e.annotation.getType() == &lt;/FONT&gt;&lt;FONT color=#800000 face="Century Schoolbook"&gt;&lt;FONT color=#800000 face="Century Schoolbook"&gt;'TextData'&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt;) {&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P&gt;AutoSaveTextEdits(e.annotation);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;P&gt;function&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt; AutoSaveTextEdits(ann) {&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;&lt;FONT color=#0000ff face="Century Schoolbook"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Century Schoolbook"&gt; _ann = ann;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face="Century </description><pubDate>Fri, 06 May 2011 10:31:00 GMT</pubDate><dc:creator>Elaine Gorham</dc:creator></item><item><title>Save embedded XMP annotation data in a Jpeg or Tiff</title><link>http://www.atalasoft.com/KB/article.aspx?id=10274</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P style="MARGIN: 0in 0in 10pt" class=ExplanationText&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Cambria&gt;&lt;FONT size=3&gt;This article is designed to be used with the Load methodology described in this KB article &lt;A href="http://www.atalasoft.com/KB/article.aspx?id=10308"&gt;http://www.atalasoft.com/KB/article.aspx?id=10308&lt;/A&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="MARGIN: 0in 0in 10pt" class=ExplanationText&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Cambria&gt;&lt;FONT size=3&gt;Jpeg and Tiff formats allow for custom tags to be added during encoding. This allows a user of DotImage to embed XMP annotation data into an image file using the JpegEncoder or TiffEncoder. The example below is an abstractified version of saving that removes the role of the AnnotationController. This allows the same code to be used to save and load in different viewers.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="MARGIN: 0in 0in 0pt" class=LanguageHeader&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;&lt;FONT color=#943634&gt;&lt;FONT face="MS Reference Sans Serif"&gt;C#&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Save(System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; s, Atalasoft.Imaging.&lt;SPAN style="COLOR: #2b91af"&gt;AtalaImage&lt;/SPAN&gt; image, &lt;SPAN style="mso-spacerun: yes"&gt;            &lt;/SPAN&gt;Atalasoft.Annotate.UI.&lt;SPAN style="COLOR: #2b91af"&gt;LayerCollection&lt;/SPAN&gt; layers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso</description><pubDate>Thu, 07 Jan 2010 08:09:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Load Annotations from Jpeg or Tiff</title><link>http://www.atalasoft.com/KB/article.aspx?id=10308</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P style="MARGIN: 0in 0in 10pt" class=ExplanationText&gt;&lt;FONT size=3 face=Cambria&gt;This article is designed to do the loading when using this article’s Save() methodology &lt;/FONT&gt;&lt;A href="http://www.atalasoft.com/KB/article.aspx?id=10274&amp;amp;cNode=0I8H4F"&gt;&lt;FONT size=3 face=Cambria&gt;http://www.atalasoft.com/KB/article.aspx?id=10274&amp;amp;cNode=0I8H4F&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Cambria&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;P style="MARGIN: 0in 0in 10pt" class=ExplanationText&gt;&lt;FONT size=3 face=Cambria&gt;To&lt;SPAN style="mso-spacerun: yes"&gt;  &lt;/SPAN&gt;load annotations from an embedded source (either Tiff or Jpeg), the LayerCollection must be Imported from the stream. Here is a method to convert from the stream to an object that contains a ImageCollection and a LayerCollection:&lt;/FONT&gt;&lt;/P&gt;&lt;P style="MARGIN: 0in 0in 0pt" class=LanguageHeader&gt;&lt;STRONG&gt;&lt;FONT color=#943634 size=3 face="MS Reference Sans Serif"&gt;C#&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: #2b91af"&gt;AnnotationLoadResults&lt;/SPAN&gt; Load(System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; s)&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;    &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;XmpAnnotationDataImporter&lt;/SPAN&gt; imp = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COL</description><pubDate>Thu, 07 Jan 2010 08:06:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Manually read XMP data into an AnnotationController</title><link>http://www.atalasoft.com/KB/article.aspx?id=10218</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;When loading XMP data into the AnnotateViewer, it will normally replace all existing annotations and layers in the control with those from the XMP.  The code in this article provides a simple method that will append the layers and annotations rather than replace them.&lt;/P&gt;&lt;P&gt;The process is simple:  Create an &lt;STRONG&gt;XmpFormatter&lt;/STRONG&gt; and use its &lt;STRONG&gt;Deserialize&lt;/STRONG&gt; method.  This will return whatever annotation, layer or layer collection that was saved.  You can then append these items into the existing AnnotationController any way you wish.&lt;/P&gt;&lt;P&gt;The method below takes the filename of the XMP data and the AnnotationController to add the annotations into.  The &lt;STRONG&gt;AnnotateViewer.Annotations&lt;/STRONG&gt; property can be passed in for the controller argument.&lt;/P&gt;&lt;PRE&gt;[C#]private void AddAnnotationData(string fileName, AnnotationController controller){   Atalasoft.Annotate.Formatters.XmpFormatter xmp = new Atalasoft.Annotate.Formatters.XmpFormatter();   object dataObject = null;   using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))   {      dataObject = xmp.Deserialize(fs);   }&lt;BR&gt;   if (dataObject == null) return;&lt;BR&gt;   // Most of the time you will receive a LayerCollection.   // In this case, we will simply add these layers into   // the existing LayerCollection.   LayerCollection layers = dataObject as LayerCollection;   if (layers != null)   {      foreach (LayerAnnotation layer in layers)      {         controller.Layers.Add(layer);      }      return;   }&lt;BR&gt;   // If you receive a single layer, simply add it.   LayerAnnotation l = dataObject as LayerAnnotation;   if (l != null)   {      controller.Layers.Add(l);      return;   }&lt;BR&gt;   // If only a single annotation is returned, add it   // to the CurrentLayer (making sure a layer exists).   AnnotationUI ann = dataObject as AnnotationUI;   if (ann !=</description><pubDate>Mon, 14 Sep 2009 15:00:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>DotAnnotate 4.0 XMP Schema</title><link>http://www.atalasoft.com/KB/article.aspx?id=10151</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;DotAnnotate has the ability to save annotations into an XMP format.  This document provides a link to the XML schema for the annotations and general information that would allow this data to be read and created by a third party.  The format is subject to change and is provided only as a guideline.&lt;/P&gt;&lt;P&gt;XMP created for DotAnnotate versions 1.0 through 4.0 contain the following namespace declaration to identify the schema version:&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P&gt;&amp;lt;rdf:Description about="" xmlns:ann="&lt;A href="http://ns.atalasoft.com/annotate/1.0/"&gt;http://ns.atalasoft.com/annotate/1.0/&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P dir=ltr&gt;The annotation data is placed inside this &lt;EM&gt;rdf:Description&lt;/EM&gt; and follows the attached schema.  There can be any number of Layer objects, each containing any number of annotations.&lt;/P&gt;&lt;P dir=ltr&gt;Cursors, Fonts and Images are stored serialized in hex format; all other values are stored as strings.&lt;/P&gt;&lt;P dir=ltr&gt;The &lt;EM&gt;Type&lt;/EM&gt; tag for Brush objects has the following values:&lt;/P&gt;&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;P dir=ltr&gt;0 = Solid Brush&lt;BR&gt;1 = Hatch Brush&lt;BR&gt;2 = Texture Brush&lt;BR&gt;3 = Linear Gradient Brush&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;All other tags represent properties of their respective object.&lt;/P&gt;</description><pubDate>Wed, 09 Sep 2009 14:06:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Save and Load annotation data for multipage tiff files</title><link>http://www.atalasoft.com/KB/article.aspx?id=10130</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;There are many different ways to save annotation data for a multi page file.  One of the best ways to do this is by saving the annotation data as metadata into a tiff tag.  With the help of the class TiffFile, this is acctualy really simply to do.&lt;/P&gt;&lt;P&gt;When saving the annotation data, once you have the data into byte array form('data' in this case), this is all you need to do:&lt;/P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;DL&gt;&lt;DT&gt;&lt;P&gt;[C#]&lt;/P&gt;&lt;FONT size=2&gt;&lt;/DT&gt;&lt;DT&gt;FileStream tiffStream = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; FileStream(@"..\..\image.tif", FileMode.Open, FileAccess.ReadWrite);&lt;/DT&gt;&lt;DT&gt;TiffFile tf = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; TiffFile();&lt;/DT&gt;&lt;DT&gt;tf.Read(tiffStream);&lt;/DT&gt;&lt;DT&gt;TiffTagCollection tagCol = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; TiffTagCollection();&lt;/DT&gt;&lt;DT&gt;tagCol = tf.Images[i].Tags;&lt;/DT&gt;&lt;DT&gt;TiffTag tag = tagCol.LookupTag(TiffTagID.WangAnnotationData);&lt;/DT&gt;&lt;DT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (tag != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/DT&gt;&lt;DT&gt;tagCol.Remove(tag);&lt;/DT&gt;&lt;DT&gt;tag = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; TiffTag(TiffTagID.WangAnnotationData, data, TiffTagDataType.Byte);&lt;/DT&gt;&lt;DT&gt;tagCol.Add(tag);&lt;/DT&gt;&lt;DT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// save the tifffile&lt;/DT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;DT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; tempPath = System.IO.Path.GetTempFileName();&lt;/DT&gt;&lt;DT&gt;tf.Save(tempPath);&lt;/DT&gt;&lt;DT&gt;tiffStream.Close();&lt;/DT&gt;&lt;DT&gt;File.Copy(tempPath, @"..\..\image.tif", &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/DT&gt;&lt;/DL&gt;&lt;/FONT&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;When loading the data into the annotate viewer, this requires a few more steps.  Remember to set the MultipageAnnotateMode property to true, so that the viewer knows to switch the annotation layers with the images.  The coralation between the layer index number and the image inde</description><pubDate>Tue, 08 Sep 2009 15:00:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Save XMP annotation data into a TIFF file</title><link>http://www.atalasoft.com/KB/article.aspx?id=10111</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;&lt;FONT color=#ff1111&gt;This article is for DotAnnotate 4.0 or earlier.  Instructions for version 5.0 and later can be found at &lt;/FONT&gt;&lt;A href="http://www.atalasoft.com/KB/article.aspx?id=10220"&gt;&lt;FONT color=#ff1111&gt;http://www.atalasoft.com/KB/article.aspx?id=10220&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#ff1111&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Use the Save method of the AnnotationController (or AnnotateViewer.Annotations) to get the annotation data.  Once you have the data, set the TiffEncoder.Xmp property and save the image.  Here is an example:&lt;/P&gt;&lt;P&gt;[C#]&lt;BR&gt;&lt;FONT color=#008000 size=2&gt;// Save the annotation data to XMP format.&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;byte&lt;/FONT&gt;&lt;FONT size=2&gt;[] data = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.annotateViewer1.Annotations.Save();&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Add the XMP data to a TiffEncoder.&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;Atalasoft.Imaging.Codec.TiffEncoder tif = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; Atalasoft.Imaging.Codec.TiffEncoder();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;tif.Xmp = data;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Save the file.&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.annotateViewer1.Save(@"C:\myfile.tif", tif);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;--------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;[Visual Basic]&lt;BR&gt;' Save the annotation data to XMP format.&lt;BR&gt;Dim data() As Byte =  Me.annotateViewer1.Annotations.Save() &lt;BR&gt; &lt;BR&gt;' Add the XMP data to a TiffEncoder.&lt;BR&gt;Dim tif As Atalasoft.Imaging.Codec.TiffEncoder =  New Atalasoft.Imaging.Codec.TiffEncoder() &lt;BR&gt;tif.Xmp = data&lt;BR&gt; &lt;BR&gt;' Save the file.&lt;BR&gt;Me.annotateViewer1.Save("C:\myfile.tif", tif)&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 08 Sep 2009 14:40:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Burn transparent Annotations on a 1 bit Image</title><link>http://www.atalasoft.com/KB/article.aspx?id=10117</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;So, you think that transparency is impossible with 1 bit images?  Well, you're right.  But that doesn't mean that we can't fake it.  A clever trick is to burn the annotation, with transparency, into an 8-bit greyscale image.  Then convert that image to 1 bit.  This will create the illusion that the annotation is transparent.&lt;/P&gt;&lt;P&gt;For this example I started off with an 8-bit greyscale image and drew a red rectangleAnnotation with alpha value of 100.  The Code for this is simply,&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;[C#]&lt;/P&gt;&lt;P&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.annotateViewer1.Annotations.CreateAnnotation(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; RectangleAnnotation(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; Pen(Color.Red),&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; SolidBrush(Color.FromArgb(100, 255,0,0))));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;[VB.NET]&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.annotateViewer1.Annotations.CreateAnnotation(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; RectangleAnnotation(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; Pen(Color.Red),&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SolidBrush(Color.FromArgb(100, 255,0,0))))&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;IMG style="WIDTH: 483px; HEIGHT: 350px" border=0 hspace=0 src="http://www.atalasoft.com/kb/Attachments/ad8a61f1-7b23-4622-b997-a645.PNG" width=1105 height=748&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Next, I burned the annotation onto the greyscale image.  Finally, I converted the Image to 1-bit.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;[C#]&lt;/P&gt;&lt;DL&gt;&lt;DT&gt;this.annotateViewer1.Burn();&lt;/DT&gt;&lt;DT&gt;foreach(Layer l in this.annotateViewer1.Annotations.Layers)&lt;/DT&gt;&lt;DL&gt;&lt;DT&gt;l.Clear();&lt;/DT&gt;&lt;/DL&gt;&lt;DT&gt;this.annotateViewer1.Refresh();&lt;/DT&gt;&lt;DT&gt;AtalaImage tmpImage = this.annotateViewer1.Image;&lt;/DT&gt;&lt;DT&gt;this.annotateViewer1.Image = tmpImage.GetChangedPixelFormat(PixelFormat.Pixel1bppIndexed);&lt;/DT&gt;&lt;/DL&gt;&lt;P&gt;[VB.NET]&lt;/P&gt;&lt;DL&gt;&lt;DT</description><pubDate>Tue, 08 Sep 2009 14:39:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Save and retrieve an image with XMP Annotations</title><link>http://www.atalasoft.com/KB/article.aspx?id=10078</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;When integrating DotAnnotate with DotImage, XMP annotations can be stored and loaded from a TIFF or JPEG image.  Saving annotations to XMP and embedding into an image requires setting the XMP property of the TIFF or JPEG codec.  The following is a VB example of saving an image with Annotations using the SaveFileDialog to specify the filename.&lt;/P&gt;&lt;P&gt;Dim xmpBytes As Byte() = Me.AnnotateViewer1.Annotations.Save()&lt;BR&gt;Dim tiff As Codec.TiffEncoder = New Codec.TiffEncoder(Codec.TiffCompression.Group4FaxEncoding)&lt;BR&gt;tiff.Xmp = xmpBytes&lt;BR&gt;Dim fs As SaveFileDialog = New SaveFileDialog&lt;BR&gt;If fs.ShowDialog(Me) = DialogResult.OK Then&lt;BR&gt;     Me.AnnotateViewer1.Save(fs.FileName, tiff)&lt;BR&gt;End If&lt;/P&gt;&lt;P&gt;To load the image with annotations back into the Viewer, use the XMP Parser as follows:&lt;/P&gt;&lt;P&gt;Dim fd As OpenFileDialog = New OpenFileDialog&lt;BR&gt;If fd.ShowDialog(Me) = DialogResult.OK Then&lt;BR&gt;     Me.AnnotateViewer1.Open(fd.FileName)&lt;BR&gt;     Dim parse As XmpParser = New XmpParser&lt;BR&gt;     Dim xmpData As Byte() = parse.BytesFromImage(fd.FileName)&lt;BR&gt;     Me.AnnotateViewer1.Annotations.Load(xmpData, Atalasoft.Imaging.Annotate.AnnotationDataFormat.Xmp)&lt;BR&gt;End If&lt;/P&gt;</description><pubDate>Tue, 08 Sep 2009 09:36:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item><item><title>Burning annotations with the WebAnnotationViewer</title><link>http://www.atalasoft.com/KB/article.aspx?id=10164</link><description>&lt;B&gt;Abstract:&lt;/B&gt; &lt;P&gt;This code sample shows how you can burn all of the annotations contained in the WebAnnotationViewer's LayerCollection onto an AtalaImage.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;AtalaImage img = BurnAnnotations(this.WebAnnotationViewer1.Annotations.Layers, this.WebAnnotationViewer1.Image);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;// Burns the given LayerCollection onto the given image if possible&lt;BR&gt;// otherwise, burns the LayerCollection onto a copy of the given image&lt;BR&gt;private AtalaImage BurnAnnotations(LayerCollection layers, AtalaImage image)&lt;BR&gt;{&lt;BR&gt;   AtalaImage burn = image;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;   if (burn != null)&lt;BR&gt;   {&lt;BR&gt;      // Can't render annotations on indexed PixelFormats&lt;BR&gt;      if (burn.PixelFormat != PixelFormat.Pixel24bppBgr &amp;amp;&amp;amp; burn.PixelFormat != PixelFormat.Pixel32bppBgra)&lt;BR&gt;      {&lt;BR&gt;         ChangePixelFormatCommand cmd = new ChangePixelFormatCommand(PixelFormat.Pixel32bppBgra);&lt;BR&gt;         burn = cmd.Apply(image).Image;&lt;BR&gt;      }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;      RenderEnvironment re = new RenderEnvironment(RenderDevice.Display, burn.GetGraphics(), new PointF(1, 1), AnnotationUnit.Pixel, null, new PointF((float)image.Resolution.X, (float)image.Resolution.Y));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;      foreach (LayerAnnotation layer in layers)&lt;BR&gt;      {&lt;BR&gt;         foreach (AnnotationUI ann in layer.Items)&lt;BR&gt;         {&lt;BR&gt;            IAnnotationRenderer renderer = AnnotationRenderers.Get(ann.Data.GetType());&lt;BR&gt;            rendere</description><pubDate>Tue, 08 Sep 2009 09:27:00 GMT</pubDate><dc:creator>Kevin Hulse</dc:creator></item></channel></rss>