annotManager.exportAnnotations()
which is the data normally sent to the serverUrl. For loading the initial annotations you can use docViewer.setInternalAnnotationsTransform(function(originalData, callback) {
and pass in a function which just calls the callback with the saved datavar annotManager;
$(document).on('viewerLoaded', function() {
var docViewer = readerControl.docViewer;
docViewer.setInternalAnnotationsTransform(function(originalData, callback) {
var savedXfdf = getAnnotationDataFromMyOfflineLocation();
callback(savedXfdf);
});
});
$(document).on('documentLoaded', function() {
annotManager = readerControl.docViewer.getAnnotationManager();
});
$('#mySaveButton').on('click', function() {
var xfdf = annotManager.exportAnnotations();
saveAnnotationsToMyOfflineLocation(xfdf);
});
annotManager.on('annotationChanged', function(e, annotations, action) {
if (e.imported) {
return;
}
var newCommand = annotManager.getAnnotCommand();
sendCommandToServer(newCommand);
});
onReceiveNewCommand(function(command) {
annotManager.importAnnotCommand(command);
});