Cuminas DjVu SDK for .NET Framework
Adding Annotations

Adding Document Properties

The following sample adds document properties using Annotation.PropertySet Property.

printheader.cs
Copy Code
using System;
using DjVu;
namespace DocProps
{
  class DocProps
  {
    static void Main(string[] args)
    {
      // TODO: ADD app's license script here or REMOVE the following line
      LicenseManager.LicenseScript = "......"; 

      using (Document doc = new Document(args[0]))
      {
        AnnoPropertySet ps = doc.SharedAnnotation.PropertySet;
        ps.Add("Title", "Document Properties");
        ps.Add("Subject", "How to add document properties");
        ps.Add("Author", "Takashi Kawasaki");
        ps.Add("Comment", "This is just a sample code.");
        ps.Add("Copyright", "(C) 2013 Cuminas Corporation. All rights reserved.");
        ps.Add("Keywords", "DjVu, Document, Annotation, Property");
        doc.SaveAs(args[1]);
      }
    }
  }
}

Adding Print Header/Footer

The following sample adds print header/footer using Annotation.PrintHeader Property/Annotation.PrintFooter Property.

printheader.cs
Copy Code
using System;
using DjVu;

namespace PrintHeader

{
  class PrintHeader
  {
    static void Main(string[] args)
    {
      // TODO: ADD app's license script here or REMOVE the following line
      LicenseManager.LicenseScript = "......"; 

      using (Document doc = new Document(args[0]))
      {
        Annotation anno = doc.SharedAnnotation;
        anno.PrintHeader.Left.Text = "Left-Top";
        anno.PrintFooter.Right.Text = "Right-Bottom";

        // Note that only Windows Viewer supports fonts
        anno.PrintHeader.Left.FontName = "Segoe UI";
        anno.PrintHeader.Left.FontSize = 12;

        doc.SaveAs(args[1]);
      }
    }
  }
}
See Also
Send Feedback