Event Handler for Pencil Movements

Product: PDFTron iOS SDK

Product Version: 9.1.0.78529

I’m working on an application that can draw on PDF and I would like to get drawing data while it’s being drawn. I searched for a method for this in the docs but couldn’t find it, can you help with this?

How to reproduce it:

  1. Open an PDF document file
  2. Select “Ink” from tool bar
  3. Draw something

Currently, I can listen to annotationAdded delegate method but it’s called only when I select another tool from the menu and it’s not what I’m looking for.

I’ve also tried touchBegins and touchMoves without any luck.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Borana,

Will this delegate method you’re looking for?
https://www.pdftron.com/api/ios/Protocols/PTPencilDrawingCreateDelegate.html#/c:objc(pl)PTPencilDrawingCreateDelegate(im)pencilDrawingCreateStrokeAdded

The delegate is provided by PTPencilDrawingCreate Class Reference

Or if you’re using freehand:
https://www.pdftron.com/api/ios/Protocols/PTFreeHandCreateDelegate.html#/c:objc(pl)PTFreeHandCreateDelegate(im)strokeAdded:

Provided by: PTFreeHandCreate Class Reference

Please let me know if this helps.

James