Link annotations being overridden when importing annotations from serverUrl

97 views
Skip to first unread message

Matt Parizeau

unread,
Oct 28, 2016, 7:21:13 PM10/28/16
to pdfnet-w...@googlegroups.com
Q:

Currently, when we have annotations enabled, and the “serverUrl” parameter defined in the configuration, the xfdf call is overriding all of the embedded link annotations in the document. As a result, none of the underlying links are clickable in our document viewer.
 
The mobile viewers that you provide for apps currently do not override link annotations when you do an xfdf merge.
 
Any insight into why this is, and any possible workarounds?

A:

That's correct, the XFDF data retrieved from the serverUrl will be used to override all annotations (including links and widgets) inside the document. If you want to import your XFDF without replacing everything, you could request from the serverUrl yourself, and then call the importAnnotations function to effectively merge the annotations into the document. So in a config file you would have the following code:

$(document).on('viewerLoaded', function() {
  readerControl
.docViewer.on('documentReady', function() {
    $
.ajax({
        url
: 'myserverurl',
        cache
: false,
        success
: function(data) {
           
var am = readerControl.docViewer.getAnnotationManager();
            am
.importAnnotationsAsync(data);
       
},
        error
: function(jqXHR, textStatus, errorThrown) {
          console
.warn(errorThrown);
       
},
        dataType
: 'xml'
   
});
 
});
});

Reply all
Reply to author
Forward
0 new messages