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.
What I want to do is just be able to loop through the annotation items that are imported. I am capturing the op.document.importCommentsAndFields, however I am not sure how to just loop through the annotation elements being imported?
Obviously the below code loops through all annotations on the document, NOT just the ones being imported.
ElseIf oper.ID = Me.docPreview.Inst.Str2ID("op.document.importCommentsAndFields", False) Then
Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.annots.delete", False)
Dim Op As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)
Dim annotsList As PDFXEdit.IPXV_AnnotsList = pxvInst.CreateAnnotsList()
For i As UInteger = 0 To Me.docPreview.Doc.CoreDoc.Pages.Count - 1
Dim page As PDFXEdit.IPXC_Page = Me.docPreview.Doc.CoreDoc.Pages(i)
Dim nCnt As UInteger = page.GetAnnotsCount()
For j As UInteger = 0 To nCnt - 1
Dim annot As PDFXEdit.IPXC_Annotation = page.GetAnnot(j)
If annot.IsMarkup Then
Dim data As PDFXEdit.IPXC_AnnotData = annot.Data
Dim mData As PDFXEdit.IPXC_AnnotData_Markup = DirectCast(data, PDFXEdit.IPXC_AnnotData_Markup)
Console.WriteLine("username: " + mData.Title)
Console.WriteLine("department: " + mData.Subject)
End If
Next
Next
I have looked at the link provided and am unable to determine how I can get the annot element of just the imported file. Is it possible for you give me a code snippet, I have got pretty good with the SDK, but can't figure this one out.
Sorry this was my mistake, the annots.changed event was firing because I was performing some other changes further down in my code.
Therefore I still require some help on this that I only wish to process the annotations that are being imported, NOT all annotations on a document. As you could imagine I could have 100 annotations on the document, I then import in an annotation .fdf file that only has 10 new annotations, I only want to process those 10 annotations, not all 110 annotations on the document.
Well, you can mark that you are doing the import in the beforeOperationExecute event, then listen to the needed event and if that marker is valid - process those annotations.
The problem is that I cannot find any event that is fired when importing annotations that would allow me to get just the annotations being imported. When the op.document.importCommentsAndFields operation is called I would have expected the e.annots.inserted to be fired, or the op.annots.addNew to be used, but this does not seem the case. I am therefore a little stuck as to how I can get this?
Then you will have to use the other way. Before the operation is executed you will have to run through all of the pages and store the annotations that are already in the document (in C++ this would be done via pointers). Then, after the operation had been executed, run through all of the annotations again and see what annotations are not in your stored list. This way, you will have all of the annotations that were imported.