Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all articles
Browse latest Browse all 2571

jso.getAnnots() returning duplicate name (key) stamps

$
0
0

I'm using VBA to parse a document for comments, and storing them in a dictionary object. I ran into an issue where jso.getAnnots is returning a duplicate name for an item.

 

Looking into the issue, there are comments with the same text that don't cause this issue.

 

Looking for a fix and the cause of this issue.

 

Why would it generate an identical name for a different comment? We've run hundreds of documents with this before and this issue has never occurred before. The name seems to be a unique key, such as "820edea8-c848-432a-aadd-987316a9ea7f".

 

Here's a snippet of the code:

 

     jso.syncAnnotScan()

      Annots = jso.getAnnots()

      '

      ' Pass one - get all the comments.

      '

Dim Annots As Object

      Dim Annot As Object

      Dim acroAnnotation As Annotation

      Dim childAnnotation As Annotation

      Dim annotationSet As New Dictionary(Of String, Annotation)

      Dim rootAnnotations As New Dictionary(Of String, Annotation)

 

        For Each Annot In Annots

                acroAnnotation = New Annotation(Annot, FromFilename)

                annotationSet.Add(Annot.name, acroAnnotation)

                If Annot.inReplyTo = "" Then

                    rootAnnotations.Add(Annot.name, acroAnnotation)

                End If

        Next Annot

 

It crashes at annotationSet.Add(Annot.name,acroAnnotation)


Viewing all articles
Browse latest Browse all 2571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>