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;