DocuVieware Reference Guide
Reference Guides > JavaScript API > Annotations > AddAnnot

This function allows you to add one or more annotations programatically (without user interaction) onto a document into the DocuVieware™ viewer.

AddAnnot: function (docuViewareID, annotationObject, success, error)


The identifier for the DocuVieware™ instance you want to add the annotation on.
A JavaScript object (or an array of objects) that contains the annotations to draw. It has the following prototype:
   type: int,
   pageNo: int,
   coordinates: {
      left: float,
      top: float,
      height: float,
      width: float
   appearance: {
      // depends on the type, please refer to the corresponding Add***AnnotInteractive method documentation for supported properties.

- type is the integer value of the member of the GdPictureAnnotationType enumeration (see list below).
- pageNo is an integer that represents the page number you want the annotation to be drawn on.
- coordinates contains the size and location (as float in inches relative to the page) of the annotation on the page.
- appearance is an object that contains the annotation style properties. Please refer to the corresponding interactive method documentation to see the complete list of properties for each annotation type.

A function that will be executed upon success.
A function that will be executed upon error.
Annotation Type
Rubberstamp 0
Rectangle 1
Rectangle Highlighter 2
Line 3
Line arrow 4
Connected line 5
Ellipse 6
Embedded image 7
Text 8
Sticky note 9
Freehand 10
Freehand highlighter 11
Freehand polygon 12
Link 13
Polygon 14
Ruler 15
Polyruler 16

You can see an example of usage of this method in the provided Barcode Recognition demo ASP.NET application (available in both Webform and MVC flavors).

Return Value

1 if error, 0 if success.