Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API

    Posted Wed August 30, 2023 10:47 AM
    Hi Guys,
     
    I am new to Deaja api. I want to add dynamic annotations programmatically in the viewer using java script api. I understood that need to create plugin for the same. I have tried below code in plug-in js file. 
    require(["dojo/_base/declare",
             "dojo/_base/lang"], 
    function(declare, lang) {
    	alert('here');		
    	ViewONE.addAnnotation("[TEXT]<P>X=300<P>Y=350<P>TEXT = This is line 1<N>This is line 2<P>FONTHEIGHT = 34<P>PAGE=1<P>EDIT = 1<P>FILLCOLOR = 255, 255, 0<P>ROTATION = 0<P>TEXTROTATION = 90<P>TRANSPARENT = 0<P>SEMITRANSPARENT = 0<P>");
    });

    Getting the following error "ViewONE is not defined". I have searched in navigator web application for the ViewONE js file. But could not find. Please let me know if the above approach correct?
    Please let me know the sequence of steps to achieve this requirement. It would be nice if you can provide some sample code.
     



    ------------------------------
    RAVI KUMAR
    ------------------------------


  • 2.  RE: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API

    Posted Fri September 01, 2023 03:31 AM

    take a look in the documentation perhaps it helps:

    Configuring the virtual viewer Client by using JavaScript

    and this  comment here: https://stackoverflow.com/questions/53777440/how-to-load-configure-ibm-daeja-viewone-in-html



    ------------------------------
    dorothea
    dorotheavulcan@yahoo.com
    ------------------------------



  • 3.  RE: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API

    Posted Mon September 04, 2023 06:30 AM

    Hi Dorothea,

    Thank you. I have gone through the documentation. As per the code, it launches viewer in a custom web application.

    My requirement is, Need to show annotations on the document viewer if the user opens a document in Content Navigator. I understood I need to do this using plugin. But not sure about the exact code.



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 4.  RE: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API

    Posted 20 days ago

    Hi Ravikumar,

    I had similar requirement and was going through your post, after some research I found the below solution and it is working for me, my requirement was I need to add water mark with User id who is retrieved and viewing the document in Deaja to avoid the screen shot and photo copies. 

    require(["dojo/_base/declare",

    "dojo/_base/lang",

    "ecm/model/Desktop",

    "ecm/widget/virtualViewer/ViewoneHTMLViewer"],

    function(declare, lang,Desktop,ViewoneHTMLViewer)

    {

    lang.extend(ViewoneHTMLViewer, {

    onDocumentLoaded : function(){

    alert("onDocumentLoaded ....!");

    var methodName = "onDocumentLoaded - " + this.viewerId;

    this.logEntry(methodName);

    var viewone =this.viewer;

    if(viewone){

    alert("Viewe one retrived...!");

    }

    //Native Deaja viewer Object , we can invoke all Deaja viewer api

    viewone.addWatermark("[TEXT]<P>X = 143<P>Y = 85<P>WIDTH = 308<P>HEIGHT = 221<P>FONTTYPE = Arial<P>FONTHEIGHT = 277.44<P>FONTSIZEORIGINAL = 100<P>SEMITRANSPARENT = 1<P>BORDER = 0<P>TEXT = "+Desktop.userId+"<P>WATERMARK = 1<P>PAGE = 1<P>COLOR = 192, 192, 192<P>TRANSPARENT = 1<P>LABEL = Text1<P>ROTATION = 0<P>TEXTROTATION = 45<P>PAGESIZE = 1734, 2156<P>EDIT = 1");

    this.logExit(methodName);

    },

    });

    });

     



    ------------------------------
    Venugopal Reddy Cholleti
    ------------------------------