How to C#: HTML5 Viewer
Annotation Default Settings
Annotation Default Settings
Home ›› XDoc.HTML5 Viewer ›› C# Viewer: Annotation Default Settings

C# HTML5 Viewer: Draw and Set Document Annotations

How to Collaborate Your Document with User-defined Annotations in C# Project Viewer

RasterEdge XDoc.HTML5 Viewer library provides C# programmers with various kinds of annotation buttons on toolbar. By creating, loading, and modifying annotations, you can collaborate with your colleagues and peers on the same document file.

Annotation Default Setting

As you see, in our online C#.NET web viewer demo, you can dynamically change the style of annotation via user interface of HTML5 document viewer. When an annotation is selected, corresponding style icon will appear clickable state. You may click on corresponding icon to change annotation property.

In addition, RasterEdge web viewer library allows C# developers to customize the default style of annotations. It is simple and straightforward. Directly copy and modify the following properties in your Default.aspx file. The code example below illustrates the default setting for text annotation. You can change FillColor:”#FFFFFF” to FillColor:”#FF0000” and the background color of text annotation will be changed to red.

// Define annotation style.
_tabAnnotations.addCommand(new CommandAnnotation("text",new AnnoStyle({OutLineWidth:3.0,OutLineColor:"#FFFFFF",FillColor: "#FFFFFF",
TextColor: "#000000", TextFont: "Arial", TextSize: 18,TextStyle :"bold",Transparency:0.8})));

Loading and Saving Annotation in Viewer

There are two ways to save annotations in your C# web viewer application. One is to save annotations separately from original document as xml files. You can load the saved xml annotations next time you view the same document. Another way is to burn annotations into original document as native graphics.