Would it be possible to post a sample of the output of GetAnnotCommand() somewhere? I like this command structure, since PDFNet can use it also, but unfortunately all of my current implementations are using PDFNet, which can't generate this command.
Thanks,
Mike
On Wednesday, January 29, 2014 8:51:56 PM UTC-5, Kevin Kuo wrote:
> Q: How can support multi-user annotation collaboration on my server and integrate it with WebViewer?
>
>
>
>
> =========================================
>
>
> A: WebViewer has been implemented with annotation collaboration in mind.
>
>
> We have implemented annot commands as a way to serialize annotations as xml to communicate with a server.
> The method is is AnnotationManager, called GetAnnotCommand()
>
>
> It is accompanied by ImportAnnotCommand, which takes the XFDF xml as a string. This loads and renders the annotations.
>
>
> To integrate annotations with your server, the steps are as followed:
> use a simple javascript polling mechanism (let's say using setInterval)on each tickcall AnnotationManager.GetAnnotCommand() to get all the "dirty" annotationsmake a POST request to your server, with the annot command string as the bodynow your server should process this these annot commands. This is where extra logic may be needed regarding permissions and how you persist the annotation data. It is up to your implementation.an example, is that your server temporarily saves the annot commands (to database or file). And returns any new annot commands it has received (from other users).in a simple scenario, you can keep track of annot commands by using timestamps on when it was sent to the server.your server will respond with any new annot commands created from other clientsyou can call AnnotationManager,ImportAnnotCommand(data) to load the annotationsso effectively, on every tick, a client sends to the server any changes it has made. The server will respond with changes that any other users have made since the last "tick".
> For on your client side, it will look something like this. Note that this code should be placed in the documentLoaded event block to ensure a document was loaded first.
>
>
> setInterval(function(){
> var am = me.docViewer.GetAnnotationManager();