AnnotationsList is empty

29 views
Skip to first unread message

Wilbur

unread,
Oct 17, 2014, 3:39:17 AM10/17/14
to pdfnet-w...@googlegroups.com
Hi Matt,

If I have a document that has some annotations written by more than one user and don't share annotations, when I view the document ,the annotationsList on the left is empty. When I toggle the annotations, it display normally. I filter the annotations like this:
 if (!me.customData.isShareAnnotations) {
     am.FilterAnnotations(am.GetCurrentUser());
      }

      am.ImportAnnotationsAsync(annotationData, function () {
       am.externalAnnotsExist = true;
       });


When I debug the follow code in AnnotationPanel.js , I found that annotations is an object of annotations, not an array. Is it a bug?
am.on('annotationFiltered', function (e, annotations) {
                console.info(annotations);
                var liList = $annotationList.children('li');
                for (var i = 0; i < liList.length; i++) {
                    $(liList[i]).remove();
                }
                for (i = 0; i < annotations.length; i++) {
                    var annot = annotations[i];
                    if (!annot.Filtered) {
                        var $li = readerControl.createAnnotationListItem(annot);
                        $annotationList.append($li);
                    }
                }
            });

By the way, could we display internal and external annotations together? And I found that If we cannot modify a Freetext annotation we can still input text into it. Could we not allow to input text into Freetext if the user doesn't have permission?

Matt Parizeau

unread,
Oct 17, 2014, 2:09:56 PM10/17/14
to pdfnet-w...@googlegroups.com
Hi Wilbur,

You're right that is a bug. You can find a fix for that issue in this build: http://pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_1.8.0.27383.zip
This build also contains a fix for the permission issue with Freetext annotations.

To display internal and external annotations together you would just not set the externalAnnotsExist property (it's false by default).

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages