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);
},
});
});
Original Message:
Sent: Mon September 04, 2023 06:29 AM
From: RAVI KUMAR
Subject: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API
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
Original Message:
Sent: Fri September 01, 2023 03:30 AM
From: dorothea vulcan
Subject: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API
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
Original Message:
Sent: Wed August 30, 2023 10:47 AM
From: RAVI KUMAR
Subject: DAEJA API: HOW TO ADD ANNOTATIONS IN VIEWER PROGRAMATICALLY USING JAVASCRIPT API
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
------------------------------