Annotation menu

67 views
Skip to first unread message

Scott Griswold

unread,
Oct 24, 2016, 12:51:59 PM10/24/16
to PDFTron WebViewer
Hello,

I have two questions:

1.  On the annotation menu is it possible to remove one or more of the annotation selections?
2.  When a user rotates a document how does that change get permanently saved?

Thanks,

Scott

Matt Parizeau

unread,
Oct 26, 2016, 4:53:11 PM10/26/16
to PDFTron WebViewer
Hi Scott,

1. Are you referring to the menu that appears above an annotation when it's selected? You can access the buttons from window.AnnotationEdit.buttons which is an array of the buttons. If you want to hide a button all the time you can could add code like the following to your config file:
var doneButton = window.AnnotationEdit.buttons[0];
doneButton
.isHidden = function() {
 
return true;
};

2. If you're using PDFNetJS to view PDFs directly you can use the document removePages function to permanently rotate on the client side. http://www.pdftron.com/webviewer/demo/lib/html5/doc/symbols/CoreControls.Document.html#removePages
If you're using XOD then you would need to persist the information about rotation on your server. One way to do it would be to send a request to your server with the information about the rotation for a particular page and then your server could store that and also give that information to the client when it loads a document (like WebViewer does with annotations) and then apply that rotation on the client side.

Another way to do it would be to still send a server request with the rotation information but apply it immediately to the associated PDF using PDFNet and then reconvert the PDF to XOD.

Let me know if that makes sense or if you need any further clarification.

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