Stop other user modifying other users comments...
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Stop other user modifying other users comments...
What is the best way to stop users modifying other users annotations?
Thanks in advance
Simon
Thanks in advance
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Hello Simon,
You will have to catch a https://sdkhelp.pdf-xchange.com/vie ... oreExecute event and see whether it's a Modify Annotations operation. If so, you can get it's input and see what annotations are being modified (use the forum search to find how to do this). If there are some that are prohibited then mark the event as Handled and set the Result to 1 - this will break the operation execution.
Cheers,
Alex
You will have to catch a https://sdkhelp.pdf-xchange.com/vie ... oreExecute event and see whether it's a Modify Annotations operation. If so, you can get it's input and see what annotations are being modified (use the forum search to find how to do this). If there are some that are prohibited then mark the event as Handled and set the Result to 1 - this will break the operation execution.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Stop other user modifying other users comments...
Alex,
I have tried to implement the following. The event is firing, however even if I move the annotation element it is not getting returned as an AnnotsEvent? Also when I drag / move an annotation element it shows me dragging it, but the e.operBeforeEvent is not fired until mouse up, surely this event should fire as soon as I try to move the annotation element?
Am I doing something wrong?
Thanks
Simon
I have tried to implement the following. The event is firing, however even if I move the annotation element it is not getting returned as an AnnotsEvent? Also when I drag / move an annotation element it shows me dragging it, but the e.operBeforeEvent is not fired until mouse up, surely this event should fire as soon as I try to move the annotation element?
Code: Select all
Private Sub docPreview_OnEvent(sender As Object, e As AxPDFXEdit._IPXV_ControlEvents_OnEventEvent) Handles docPreview.OnEvent
If e.nEventID = nIDS(CInt(IDS.e_operBeforeExecute)) Then
Dim annotsEvent As PDFXEdit.IPXV_AnnotsEvent = TryCast(e.pEvent, PDFXEdit.IPXV_AnnotsEvent)
If annotsEvent IsNot Nothing Then
Console.WriteLine("BeforeEvent is annotation item")
End If
End If
End Sub
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Please read more carefully:
Then take the ID of the operation and see whether it's a needed operation. After that check the input array:
Cheers,
Alex
Here's what you needed to search for on forums:Sasha - Tracker Dev Team wrote: You will have to catch a https://sdkhelp.pdf-xchange.com/vie ... oreExecute event and see whether it's a Modify Annotations operation. If so, you can get it's input and see what annotations are being modified (use the forum search to find how to do this). If there are some that are prohibited then mark the event as Handled and set the Result to 1 - this will break the operation execution.
Code: Select all
PDFXEdit.IOperation oper = (PDFXEdit.IOperation)e.pFrom;
Code: Select all
PDFXEdit.ICabNode input = oper.Params.Root["Input"];
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Stop other user modifying other users comments...
Hi Alex,
Thanks for your help.
Almost getting there with it now, however struggling on getting the author value of the annotation, obviously doing something wrong. I guess I need to somehow get the annotation element from the event?
Thanks in advance
Simon
Thanks for your help.
Almost getting there with it now, however struggling on getting the author value of the annotation, obviously doing something wrong. I guess I need to somehow get the annotation element from the event?
Code: Select all
Dim oper As PDFXEdit.IOperation = DirectCast(e.pFrom, PDFXEdit.IOperation)
Dim input As PDFXEdit.ICabNode = oper.Params.Root("Input")
Dim commands As String = Me.docPreview.Inst.ID2Str(oper.ID)
Console.WriteLine("e: " & commands)
If oper.ID = Me.docPreview.Inst.Str2ID("op.annots.move", False) Then
Dim options As PDFXEdit.ICabNode = oper.Params.Root("Options")
Dim annoUser As String = options("Author").v.ToString
If annoUser = MISData.Instance.ADUserName Then
Console.WriteLine("Annotation move user the same")
Else
Console.WriteLine("Annotation move user NOT the same")
End If
End If
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Hello Simon,
Well there is no Author in these options here:
https://sdkhelp.pdf-xchange.com/vie ... ve_Options
You don't need the operation's options at all - you just have to get the IPXC_Annotation objects from the Input cab node.
Cheers,
Alex
Well there is no Author in these options here:
https://sdkhelp.pdf-xchange.com/vie ... ve_Options
You don't need the operation's options at all - you just have to get the IPXC_Annotation objects from the Input cab node.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Stop other user modifying other users comments...
OK Alex,
But how do you do that?
Thanks
Simon
But how do you do that?
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Hello Simon,
Look at the Input description here and at a sample available:
https://sdkhelp.pdf-xchange.com/vie ... nnots_move
Just cast a cab node elements of the array from the IUnknown to the IPXC_Annotation interface - that's all.
Cheers,
Alex
Look at the Input description here and at a sample available:
https://sdkhelp.pdf-xchange.com/vie ... nnots_move
Just cast a cab node elements of the array from the IUnknown to the IPXC_Annotation interface - that's all.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Stop other user modifying other users comments...
Alex,
Sorry I must be very tired as I cannot see how the example code would is the same situation as the IPXC_Annotation element is past as a parameter.
I have tried the following, but still not working, obviously doing a lot wrong!!
Thanks
Simon
Sorry I must be very tired as I cannot see how the example code would is the same situation as the IPXC_Annotation element is past as a parameter.
I have tried the following, but still not working, obviously doing a lot wrong!!
Code: Select all
Dim oper As PDFXEdit.IOperation = DirectCast(e.pFrom, PDFXEdit.IOperation)
Dim input As PDFXEdit.ICabNode = oper.Params.Root("Input")
Dim commands As String = Me.docPreview.Inst.ID2Str(oper.ID)
Console.WriteLine("e: " & commands)
If oper.ID = Me.docPreview.Inst.Str2ID("op.annots.move", False) Then
Dim annoItems() As Object = input.v
For i As Integer = 0 To annoItems.Length - 1
Dim annot As PDFXEdit.IPXC_Annotation = annoItems(i)
Console.WriteLine("AnnoType: " & annot.Type)
Next
End If
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Hello Simon,
What I meant was this:
Cheers,
Alex
What I meant was this:
Code: Select all
PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
for (uint i = 0; i < input.Count; i++)
{
PDFXEdit.ICabNode ai = input[i];
IPXC_Annotation annot = ai.v as IPXC_Annotation;
}
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Stop other user modifying other users comments...
Thanks Alex,
So now I have got the annotation element. How would I go about getting the Author of the annotation element?
Thanks in advance
Simon
So now I have got the annotation element. How would I go about getting the Author of the annotation element?
Thanks in advance
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Stop other user modifying other users comments...
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ