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
- Clone the
PSPDFKit/Xamarin-iOS
repository from GitHub. - Open the
Xamarin-iOS
directory.
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
PSPDFKit.framework
into thePSPDFKit.Mac
folder.
Step 3 — Get the DLL
You have two options to get the DLL.
Using Visual Studio for Mac
- Open
PSPDFKit.sln
, which is located in the root folder. - Build the
macOS
project inside the solution. - Get the DLL from the
bin
folder ofPSPDFKit.Mac
.
Using the Command Line / Terminal
We use Cake as our build system.
- Run the
./build.sh --target mac
(macOS) command from theroot
directory. - The resulting DLL will be inside the root folder.
Step 4 — Integrate into Your Project
- Add a reference of
PSPDFKit.Mac.dll
to your project. - Add the following namespace to your project:
1 | 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
.