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
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|
|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:
Add SDKs and driver implementations for each stylus you want to support.
Before creating a
PSPDFViewController, register the driver classes by setting
If you use
PSPDFAnnotationToolbar, show the stylus button by setting
To see this in action, take a look at our example
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.