Annotation Selection issue.

119 views
Skip to first unread message

Anish Jain

unread,
Apr 16, 2014, 9:30:26 AM4/16/14
to pdfnet-w...@googlegroups.com
Hi,
     We are facing some issue related to annotation.
     When we select particular annotation, it will create border containing some circle.
     That circle is not user friendly, so we want to remove that.

    For that please refer following attachment.
    https://drive.google.com/folderview?id=0BwudxV-EWyTQMy1vVWdTOG9aQ1E&usp=sharing

Thanks,
Anish Jain 

Matt Parizeau

unread,
Apr 17, 2014, 1:44:30 PM4/17/14
to pdfnet-w...@googlegroups.com
Hi Anish,

The circles are the control handles for resizing the annotation. To remove them you can create a custom selection model that doesn't include these control handles. If you wanted to remove the control handles from all Rectangle Annotations then you could have code like this:
var CustomSelectionModel = function(annotation, canModify) {
   
Annotations.SelectionModel.call(this, annotation, canModify);
};
CustomSelectionModel.prototype = $.extend(true, new Annotations.BoxSelectionModel(), CustomSelectionModel.prototype);
Annotations.RectangleAnnotation.prototype.selectionModel = CustomSelectionModel;

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Sweta Sonegra

unread,
Apr 18, 2014, 5:16:33 AM4/18/14
to pdfnet-w...@googlegroups.com

Thanks Matt. It worked but with this code we are able to get rid of only circles. What we want to do is get rid of the blue border too. How can we do that?

Matt Parizeau

unread,
Apr 21, 2014, 6:15:07 PM4/21/14
to pdfnet-w...@googlegroups.com
You would just have to add a little bit the previously posted code to override the selection outline drawing:
var CustomSelectionModel = function(annotation, canModify) {
   
Annotations.SelectionModel.call(this, annotation, canModify);
};
CustomSelectionModel.prototype = $.extend(true, new Annotations.BoxSelectionModel(), {
    drawSelectionOutline
: function() {}
});
Annotations.RectangleAnnotation.prototype.selectionModel = CustomSelectionModel;

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Reply all
Reply to author
Forward
0 new messages