I have the following scenario:
The user selects and copies an annotation which is on a document page to the clipboard. After pasting it I need to modify certain annotation properties like (author, name, readOnly etc.) of the new annotation.
I'm aware of the OnEvent of the activeX control and currently I do have the following code:
Code: Select all
If (e.type = PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnNamedNotify) And (e.name = "Notifications.NewAnnotAdded") Then
Dim newAnnotName As Object = ""
Dim pageIndex As Object = -1
AxCoPDFXCview1.GetProperty("Notifications.NewAnnotAdded.PageIndex", pageIndex, 0)
AxCoPDFXCview1.GetProperty("Notifications.NewAnnotAdded.Name", newAnnotName, 0)
If (pageIndex >= 0) Then
Dim js As String = "var ann = this.getAnnot(" + CStr(pageIndex) + ", '" + newAnnotName + "'); if (ann.readOnly == 1) { ann.readOnly = false; ann.name = 'TestID'; ann.author = '" + Environment.UserName + "'; app.alert(ann.author) }"
AxCoPDFXCview1.RunJavaScript(js)
End If
End If
Is there a way to get access to the new added annotation? (Maybe direcly out of the clipboard?)
I would higly appreciate it if you guys could help me or give me an advise how to do this.
Thank you!
Martin