Stylus Support


PSPDFKit for iOS includes support for all major stylus vendors. Apple Pencil support was added in 5.1 and improved in 6.5. See the Apple Pencil guide to learn more. This guide is about third-party stylus support. As a starting point, look at the PSCStylusSupportExample.m file in the dmg-download of the framework, under Extras/StylusSupport.

Stylus connection and events are handled by PSPDFStylusManager, which uses a set of drivers. A stylus driver is class that implements the PSPDFStylusDriver protocol. Each stylus vendor uses a different SDK for hardware communication. We can't ship these SDKs for license reasons, but we ship corresponding PSPDFStylusDriver classes that bridge each SDK to PSPDFStylusManager. Via this generic approach you can even add support for SDKs that we don't yet support. (Or better, ping us and we might add it ourselves.)

Note: The stylus drivers are not available in the evaluation demo.

Vendor PSPDFKit Driver File Name Download Product
FiftyThree PSPDFFiftyThreeStylusDriver.m Download Pencil
Adonit PSPDFAdonitStylusDriver.m Download Pixelpoint
Wacom PSPDFWacomStylusDriver.m Download Intuos
Ten One Design PSPDFPogoStylusDriver.m Download Pogo

Note that each SDK supports one or multiple hardware products. We only list the SDK since the individual companies might change their hardware offerings over time. We're not affiliated with any of these companies and provide Amazon links just for convenience.

To use a stylus:

  1. Add SDKs and driver implementations for each stylus you want to support.

  2. Before creating a PSPDFViewController, register the driver classes by setting PSPDFKit.sharedInstance.stylusManager.availableDriverClasses.

  3. If you use PSPDFAnnotationToolbar, show the stylus button by setting showingStylusButton to YES.

To see this in action, take a look at our example PSCStylusSupportExample.m.

Known Issues

There are issues with the iPad Pro and Wacom stylus products, and we have contacted Wacom support to make them aware of this.

Prior PSPDFKit 6.5, the included drivers for both FiftyThree and Adonit tried to swizzle -[UIApplication sendEvent:] to pspdf_pencilSendEvent which resulted in the second one to be enabled not working. The example code has now been updated to use distinct selectors.

Was this page helpful? We're happy to answer any questions.