Hi sir,
we already purchase viewer
I need to get the left, top, width and height when add the annotation in viewer to store in DB after close and view the sample in need to show annotation as we add the annotation at what position.
Now i get all properties except left, top, width, height i give hardcode the height,width,left,top so please assists us.
how to get left,top,width and height when add annotation in server side
-
- Posts: 11
- Joined: Tue Feb 07, 2023 6:19 am
Re: how to get left,top,width and height when add annotation in server side
Hello,
Here is a code snippet to get the coordinates of an annotation when it has been drawn in the viewer:
Best regards,
Fabio
Here is a code snippet to get the coordinates of an annotation when it has been drawn in the viewer:
Code: Select all
function RegisterOnAnnotationAddedOnDocuViewareAPIReady() {
if (typeof DocuViewareAPI !== "undefined" && DocuViewareAPI.IsInitialized("DocuVieware1")) {
DocuViewareAPI.RegisterOnAnnotationAdded("DocuVieware1", function (annot) {
var myAnnot = DocuViewareAPI.GetAnnotProperties("DocuVieware1", annot.id);
console.log("top: " + myAnnot.top);
console.log("left: " + myAnnot.left);
console.log("width: " + myAnnot.width);
console.log("height: " + myAnnot.height);
});
}
else {
setTimeout(function () { RegisterOnAnnotationAddedOnDocuViewareAPIReady() }, 10);
}
}
document.addEventListener("DOMContentLoaded", function () {
RegisterOnAnnotationAddedOnDocuViewareAPIReady();
}, false);
Fabio
Who is online
Users browsing this forum: No registered users and 1 guest