Microsoft Xamarin

Developers can use Xamarin to write native iOS, Android, and macOS apps with a shared C# codebase. We provide separate bindings for iOS and Android, as they are different SDKs and have an API that closely matches the underlying system.

PSPDFKit for macOS

PSPDFKit for macOS includes full-featured bindings for Xamarin/Visual Studio. We work closely with Xamarin to provide up-to-date bindings shortly after the regular PSPDFKit releases. These bindings allow extensive customization and subclassing.

You can try the demo by first requesting it from our website and then adding the PSPDFKit binary to the Xamarin binding.

Building PSPDFKit.Mac.dll

In order to build this binding project, you need the following:

  • Visual Studio for Mac
  • Xamarin.Mac 6.x +

Step 1 — Get the Bindings

  1. Clone the PSPDFKit/Xamarin-iOS repository from GitHub.
  2. Open the Xamarin-iOS directory.

Step 2 — Copy the Required Files

  1. Download PSPDFKit for macOS from the Customer Portal if you haven’t done so already.
  2. Alternatively, request a trial version if you’re not yet a customer.
  3. Open the DMG file you downloaded above and copy PSPDFKit.framework into the PSPDFKit.Mac folder.

Step 3 — Get the DLL

You have two options to get the DLL.

Using Visual Studio for Mac

  1. Open PSPDFKit.sln, which is located in the root folder.
  2. Build the macOS project inside the solution.
  3. Get the DLL from the bin folder of PSPDFKit.Mac.

Using the Command Line / Terminal

We use Cake as our build system.

  1. Run the ./ --target mac (macOS) command from the root directory.
  2. The resulting DLL will be inside the root folder.

Step 4 — Integrate into Your Project

  1. Add a reference of PSPDFKit.Mac.dll to your project.
  2. Add the following namespace to your project:
using PSPDFKit.Core;

Set the License Key

Call PSPDFKitGlobal.SetLicenseKey("YOUR_LICENSE_KEY_GOES_HERE"); early on in your app delegate before accessing any other PSPDFKit classes.

Getting Started

If you need a little more information, you can take a look at our MacPDFViewer example project.