Change default style of free hand annotations

60 views
Skip to first unread message

Patrick Herber

unread,
May 16, 2017, 11:38:26 AM5/16/17
to PDFTron WebViewer
Hello!
Currently when we add a free hand annotation this appears in black with a width of 1px.
We would like to change these default settings to colour red, width 3px.
Is it possible? How should we proceed?
Thanks and best regards
Patrick

Justin Jung

unread,
May 16, 2017, 7:58:23 PM5/16/17
to PDFTron WebViewer
Hello,

You can add the following to config.js:
$(document).on('viewerLoaded', function() {
  var freeHandTool = readerControl.toolModeMap.AnnotationCreateFreeHand;
  freeHandTool.defaults.StrokeColor = new Annotations.Color(255, 0, 0);
  freeHandTool.defaults.StrokeThickness = 3;
});

Justin Jung
Software Developer
PDFTron Systems Inc.

Patrick Herber

unread,
May 18, 2017, 11:42:12 AM5/18/17
to PDFTron WebViewer
It works perfectly!
Thanks a lot for your great support.

Parag Shah

unread,
May 30, 2017, 3:13:20 PM5/30/17
to PDFTron WebViewer
Hi Justin,

Is there a way to disable the default invoke of the free hand tool. We want that the users shouldn't have any annotation tool selected by default when the document is opened.

Justin Jung

unread,
May 31, 2017, 7:29:12 PM5/31/17
to PDFTron WebViewer
Hello,

Are you referring to the Annotation Sample? In that sample, we have custom code that sets the FreeHandTool to be the current tool, but in normal WebViewer that doesn't happen.
Reply all
Reply to author
Forward
0 new messages