How to get event handler when annotation function drag

Discussions about annotation support.
Post Reply
senthil205
Posts: 14
Joined: Tue Feb 07, 2023 6:19 am

How to get event handler when annotation function drag

Post by senthil205 » Wed Feb 08, 2023 9:38 am

Hi sir,

I need to get event handler when annotation function drag in Docuvieware (using web).

senthil205
Posts: 14
Joined: Tue Feb 07, 2023 6:19 am

Re: How to get event handler when annotation function drag

Post by senthil205 » Wed Feb 08, 2023 11:30 am

senthil205 wrote:
Wed Feb 08, 2023 9:38 am
Hi sir,

I need to get event handler when annotation function drag in Docuvieware (using web).

i use like this

AddHandler DocuViewareEventsHandler.CustomAction, AddressOf handleCustomAction


but event not triger

senthil205
Posts: 14
Joined: Tue Feb 07, 2023 6:19 am

Re: How to get event handler when annotation function drag

Post by senthil205 » Fri Feb 17, 2023 7:02 am

What is status?

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: How to get event handler when annotation function drag

Post by Fabio » Fri Feb 17, 2023 6:39 pm

Hello Sir,

Sorry for my late reply.
You can simply use the javascript event RegisterOnAnnotationMoved -> https://www.docuvieware.com/guides/aspn ... Moved.html

And in there, you can use the PostCustomServerAction method to request server-side code or use any other javascript methods.

Best regards,
Fabio

senthil205
Posts: 14
Joined: Tue Feb 07, 2023 6:19 am

Re: How to get event handler when annotation function drag

Post by senthil205 » Mon Feb 20, 2023 7:10 am

Hi sir,

Thanks for reply, i need to get the properties of annotation to store in DB and take the value from DB and second time we show in viewer

for example server side code:

Dim annotstick As GdPicture14.Annotations.AnnotationStickyNote = annotMgr.AddStickyNoteAnnot(1, 1, 2, 2, "Sticky Note by GdPicture")
If (annotMgr.GetStat() = GdPictureStatus.OK) AndAlso (annotstick IsNot Nothing) Then
annotstick.Alignment = System.Drawing.StringAlignment.Center
annotstick.Author = "GdPicture"
annotstick.BorderWidth = 0.05F
annotstick.Fill = True
annotstick.FillColor = Color.LightBlue
annotstick.FontSize = 20
annotstick.Opacity = 0.7F
annotstick.StrokeColor = Color.DarkBlue
End If

for this i hardcode the value to create sticky note, now i want to get this properties value dynamically

using this below code:

document.addEventListener("DOMContentLoaded", function () {
RegisterOnAnnotationAddedOnDocuViewareAPIReady();
RegisterOnAnnotationDeletedOnDocuViewareAPIReady();
}, false);


//// event annot Added
function RegisterOnAnnotationAddedOnDocuViewareAPIReady() {
if (typeof DocuViewareAPI !== "undefined" && DocuViewareAPI.IsInitialized("DocuVieware1")) {
DocuViewareAPI.RegisterOnAnnotationAdded("DocuVieware1", function (annot) {
alert("Annotation added: " + annot.id);
alert("Annotation annotType: " + annot.timeStampAppearance);
});
}
else {
setTimeout(function () { RegisterOnAnnotationAddedOnDocuViewareAPIReady() }, 10);
}
}
i get the id, but how we get properties

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests