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.
In order to build this binding project, you need the following:
- Visual Studio for Mac
- Xamarin.Mac 6.x +
Step 1 — Get the Bindings
- Clone the
PSPDFKit/Xamarin-iOSrepository from GitHub.
- Open the
Step 2 — Copy the Required Files
- Download PSPDFKit for macOS from the Customer Portal if you haven’t done so already.
- Alternatively, request a trial version if you’re not yet a customer.
- Open the DMG file you downloaded above and copy
Step 3 — Get the DLL
You have two options to get the DLL.
Using Visual Studio for Mac
PSPDFKit.sln, which is located in the root folder.
- Build the
macOSproject inside the solution.
- Get the DLL from the
Using the Command Line / Terminal
We use Cake as our build system.
- Run the
./build.sh --target mac(macOS) command from the
- The resulting DLL will be inside the root folder.
Step 4 — Integrate into Your Project
- Add a reference of
PSPDFKit.Mac.dllto your project.
- Add the following namespace to your project:
Set the License Key
PSPDFKitGlobal.SetLicenseKey("YOUR_LICENSE_KEY_GOES_HERE"); early on in your app delegate before accessing any other PSPDFKit classes.
If you need a little more information, you can take a look at our
MacPDFViewer example project.