Loads annotations from a JSON string.

Introduced: X19.

<void> TXDocumentViewer.annotations.load(<string> annotations);

Parameters

Parameter Description
annotations The annotations in form of a JSON string.

Examples

This sample loads a single annotation into the current document view.

// Create a new JSON string that contains comment objects

var myComments = `[
   [
      {
         "pen":{
            "type":"comment",
            "objectWidth":32,
            "objectHeight":32
         },
         "user":"Tim Typer",
         "location":{
            "x":278.31784841075796,
            "y":192.52811735941322
         },
         "time":1625843290931,
         "comments":[
            {
               "comment":"First comment",
               "user":"Tim Typer",
               "date":1625843301808,
               "id":"b1bece69-e3da-4c0c-aa80-1fe3e5e4d8f6",
               "status":"none"
            }
         ],
         "id":"42cafe08-34c3-4925-9d37-10d849968bbb",
         "status":"Accepted"
      }
   ],
   [

   ],
   [

   ]
]`;

// load the annotations
TXDocumentViewer.annotations.load(myComments);