Xamarin - Stylus Support


After successfully building PSPDFKit.iOS.dll you can add stylus support to the framework by following these steps:

Step 1 - Copy required files

  1. Copy PSPDFKit.framework into StylusDrivers/externals.
  2. Copy Extras/StylusSupport/Drivers (you can find this folder in the dmg you downloaded from your customer portal) into StylusDrivers/externals.

Step 2 - Add stylus SDKs

  1. Visit our stylus support documentation for a list of supported styluses and download links for the vendor SDKs.
  2. After downloading the vendor SDKs (.framework and .bundle files) you integrate them by moving them into StylusDrivers/externals.

Step 3 - Building the stylus drivers

  1. Switch to the Xamarin-iOS/StylusDrivers folder in a terminal.
  2. You can see all available build options by running $ make.
  3. To build all drivers call $ make alldrivers. To build individual drivers call $ make adonit for example.
  4. The compiled driver Dlls will be placed in the Xamarin-iOS/StylusDrivers folder.

Step 4 - Integrating the stylus drivers

  1. Start by adding the compiled driver Dlls into the PSPDFKit.iOS binding project reference:

  1. Do the same for your app's references:

Afterwards your directory structure should look like this:

  1. Open PSPDFKit.iOS/StylusSupport.cs and uncomment all the drivers you previously integrated:

  1. Review "Stylus Support" section of DVCMenu.cs and Catalog/Customization/PSCStylusEnabledAnnotationToolbar.cs for implementation details.

Step 5 - Test stylus support

Our sample project PSPDFCatalog contains an example called "Stylus Support" that adds a stylus button the annotation toolbar:

After pressing this button you should see a list of all the stylus types you added drivers for:

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