Hello Stefan,
sometimes it's the simple things

! You were right, I was using build 207 and with build 210 it works!
Here is my VB .NET code, maybe useful to other users:
Code: Select all
Private Sub AxPDFXViewCtrl_OnEvent(sender As Object, e As AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent) Handles AxPDFXViewCtrl.OnEvent
Dim oDataIn As Object
Dim oDataOut As Object
Dim iPageIndex As Integer
Dim iAnnotHasBeenCreated As Integer
Dim strAnnotName As String
Dim dblPosition As Double() = New Double() {0, 0, 0, 0}
oDataIn = 0
oDataOut = Nothing
If intPDocCurrentID > 0 Then
If e.type = PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnNamedNotify And e.name = "Notifications.NewAnnotAdded" Then
AxPDFXViewCtrl.GetProperty(e.name + ".Temp", oDataOut)
iAnnotHasBeenCreated = DirectCast(oDataOut, Integer)
If iAnnotHasBeenCreated = 0 Then '// (isTemp != 0) - the creation of annot isn't finished
'AxPDFXViewCtrl.GetProperty(e.name + ".DocID", oDataOut)
'intPDocCurrentID = DirectCast(oDataOut, Integer)
AxPDFXViewCtrl.GetProperty(e.name + ".PageIndex", oDataOut)
iPageIndex = DirectCast(oDataOut, Integer)
AxPDFXViewCtrl.GetProperty(e.name + ".Name", oDataOut)
strAnnotName = DirectCast(oDataOut, String)
oDataIn = AnnotNameToIndex(intPDocCurrentID, iPageIndex, strAnnotName)
AxPDFXViewCtrl.DoDocumentVerb(intPDocCurrentID, "Pages[" + iPageIndex.ToString + "]", "GetAnnotRect", oDataIn, oDataOut, 0)
If oDataOut Is Nothing = True Then
iSigFieldValues = New Integer() {0, 0, 0, 0}
End If
If oDataOut.GetType.Name <> "Double[]" Then
iSigFieldValues = New Integer() {0, 0, 0, 0}
End If
dblPosition = TryCast(oDataOut, Double())
ReDim iSigFieldValues(dblPosition.Length)
For iPosition = 0 To dblPosition.Length - 1
iSigFieldValues(iPosition) = Convert.ToInt32(dblPosition(iPosition))
Next
Console.WriteLine("Positions of signature fields")
Console.WriteLine("--------------------------------------")
Console.WriteLine("Left:" + iSigFieldValues(0).ToString)
Console.WriteLine("Top:" + iSigFieldValues(1).ToString)
Console.WriteLine("Right:" + iSigFieldValues(2).ToString)
Console.WriteLine("Bottom:" + iSigFieldValues(3).ToString)
End If
End If
End If
Console.WriteLine(e.name)
End Sub
Private Function AnnotNameToIndex(ByVal DocID As Integer, ByVal PageIndex As Integer, ByVal AnnotName As String) As Integer
Dim oDataIn As Object
Dim oDataOut As Object
Dim strPageName As String
Dim iAnnot As Integer
Dim iAnnots As Integer
oDataIn = Nothing
oDataOut = Nothing
strPageName = "Pages[" + PageIndex.ToString + "]"
AxPDFXViewCtrl.DoDocumentVerb(DocID, strPageName, "GetAnnotsCount", oDataIn, oDataOut, 0)
iAnnots = DirectCast(oDataOut, Integer)
For iAnnot = 0 To iAnnots - 1
oDataIn = iAnnot
oDataOut = ""
AxPDFXViewCtrl.DoDocumentVerb(DocID, strPageName, "GetAnnotName", oDataIn, oDataOut, 0)
If DirectCast(oDataOut, String) = AnnotName Then
Return iAnnot
End If
Next
Return -1
End Function
Thank you so much!
Karl