How to group freehand annotation strokes together on Android and iOS?

128 views
Skip to first unread message

Shirley Gong

unread,
Feb 12, 2016, 8:53:40 PM2/12/16
to pdfne...@googlegroups.com
Question:

I am adding stylus drawing support to my app using PDFNet Android and iOS SDK. By default, whenever the user lifts the stylus up after drawing, a new annotation is created every time. How do I create Freehand annotations that contain multiple disconnected paths?

Answer:

Android:
To enable multi-stroke mode for freehand tool, use the following:
mToolManager.setTool(mToolManager.createTool(com.pdftron.pdf.tools.ToolManager.e_ink_create, null));
((com.pdftron.pdf.tools.FreehandCreate)mToolManager.getTool()).setMultiStrokeMode(true);


To enable advanced stylus writing mode (when enabled, user will be able to use stylus as inking tool and use finger to pan and zoom; strokes are grouped by location and timing), use the following:
mToolManager.setStylusAsPen(true);



iOS:
To enable multi-stroke mode for freehand tool, use the following:
FreeHandCreate* fhc = (FreeHandCreate*)[_toolManager changeTool:[FreeHandCreate class]];
fhc
.multistrokeMode = YES;
fhc
.delegate = self;

Azarias Fergus

unread,
Jun 29, 2017, 12:48:25 PM6/29/17
to PDFTron PDFNet SDK
Do you know of any place where I can get documentation for the freehandCreate Class?

Ryan

unread,
Jun 30, 2017, 6:33:20 PM6/30/17
to PDFTron PDFNet SDK
Reply all
Reply to author
Forward
0 new messages