Overriding signature widget border

32 views
Skip to first unread message

Matt Parizeau

unread,
Dec 14, 2016, 8:46:18 PM12/14/16
to pdfnet-w...@googlegroups.com
Q:

A signature widget inside my PDF document has a small grey border but I want it to appear without a border. Is it possible to remove it?

A:

If a signature doesn't have a default appearance defined then when the image element for the signature is added it doesn't have a src attribute. In Chrome and Safari it seems that they will add a default border for images that don't have a src which isn't able to be removed through CSS.

You can use the following code in a config file to set the default appearance to be an empty image which will get rid of the gray border.

$(document).on('viewerLoaded', function(e, annot, container) {
  readerControl
.docViewer.on('documentReady', function() {
   
var annotManager = readerControl.docViewer.getAnnotationManager();
    annotManager
.getAnnotationsList().forEach(function(annot) {
     
if (annot instanceof Annotations.SignatureWidgetAnnotation) {
       
if (!annot.appearances['_DEFAULT']) {
          annot
.appearances['_DEFAULT'] = {
           
Normal: 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw=='
         
};
          annot
.appearance = '_DEFAULT';
       
}
     
}
   
});
 
});
});

Reply all
Reply to author
Forward
0 new messages