How to group freehand annotation strokes together?

22 views
Skip to first unread message

Ryan

unread,
Feb 9, 2016, 1:11:33 PM2/9/16
to PDFTron PDFNet SDK
Question:

I am adding stylus drawing support to my app using PDFViewWPF. 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:
The FreeHand class in PDFViewWPF tools creates Ink class in the PDF. Ink annotations are made up of a set of paths, and each path has a set of points. So each Path is a continuous line, but the annotation as a whole can be made up of thousands of connected and/or disconnected paths.

See Ink.SetPoint function, where the first parameter is the path index.

So you create a single annotation, and every time the user lifts the stylus up, you increment the path counter, so if they start drawing again, this will be a new path, but part of the same annotation.

Typically apps use a button to enter/exit drawing mode.
Reply all
Reply to author
Forward
0 new messages