Clear annotation from managed list of annotations.

55 views
Skip to first unread message

Sweta Sonegra

unread,
Feb 14, 2014, 5:44:22 AM2/14/14
to pdfnet-w...@googlegroups.com
Hi,

I am using PDFtron web viewer in my HTML 5 MVC website.

What I am doing is loading the viewer once. After that if the viewer is already loaded then just opening next book.

Facing Issue: The previous book annotation are seen in next book.

Want to fix: I want to clear the annotation that are already loaded.

Kevin Kuo

unread,
Feb 17, 2014, 6:53:29 PM2/17/14
to pdfnet-w...@googlegroups.com
I suspect the issue has to do with saving/loading annotations from the server.
When WebViewer sends requests to the server, it will append a document id in the query so the server can uniquely identity documents (and keep annotation xfdf files separate).

To workaround the problem, before loading a new document with loadDocument, set a new document ID.

For example:
 if(myWebViewer.selectedType === "html5"){
     myWebViewer
.getInstance().doc_id = "new_document_id";
 
}
 myWebViewer
.loadDocument($('#documentURL').val());

It is then up to the server script to respect the document ID and return the correct XFDF annotation data to the client.
Reply all
Reply to author
Forward
0 new messages