- Xamarin.iOS Bindings for PSPDFKit 8.2.3 for iOS
- Xamarin.Mac Bindings for PSPDFKit 3.2.0 for macOS
Xamarin.Android Bindings for PSPDFKit for Android: PSPDFKit/Xamarin-Android
The PSPDFKit SDK is a framework that allows you to view, annotate, sign, and fill PDF forms on iOS, Android, Windows, macOS, and Web.
PSPDFKit Instant adds real-time collaboration features to seamlessly share, edit, and annotate PDF documents.
In order to build this binding project you need:
- Visual Studio for Mac or Windows
- Xamarin.iOS 11.12 (d15-7) +
- Xamarin.Mac 4.4 (d15-7) +
- Clone this repository to your computer.
- Open the
Xamarin-iOS
directory.
- Download PSPDFKit for iOS and/or Mac from your customer portal if you haven't done so already, or request an evaluation version.
- Open the dmg file you downloaded in step 1 and copy the following files into the specified directories:
iOS: From PSPDFKit-for-iOS dmg.
- Copy
PSPDFKit.framework
into PSPDFKit.iOS.Model folder. - Copy
PSPDFKitUI.framework
into PSPDFKit.iOS.UI folder. * - Copy
Instant.framework
into PSPDFKit.iOS.Instant folder. *
Mac: From PSPDFKit-for-macOS dmg.
- Copy
PSPDFKit.framework
into PSPDFKit.Mac.Model folder. *
*
Items with an asterisk are optional, if you do not provide a framework, by default we won't generate its bindings, but most of the time you will want to provide PSPDFKit.framework
and PSPDFKitUI.framework
at minimum.
- Open
PSPDFKit.sln
located in the root folder. - Build the binding projects inside the
iOS
orMac
solution folders. - Get the dlls from the
bin
folder of each project. - Go to Step 4 - Integrating into your ptoject.
We are using Cake as our build system, this allows us to build on both Windows and Mac from a single script.
- Run
./build.sh
(Mac) /.\build.ps1
(Windows) command from the root directory. - All the resulting dlls will be inside the root folder.
- Go to Step 4 - Integrating into your ptoject.
We use the Default
build task which builds all binding projects as long as the frameworks are present inside each directory (see Step 2 - Copy required files), if an optional framework is not present this Task will just skip.
In the case you just want the Mac bits to be built you can do ./build.sh --target mac
. Here are the most common tasks available in the build script, they are particularly useful when you are integrating this into a CI Server.
General Tasks | |
---|---|
Task | Description |
Default | Builds all PSPDFKit dlls. |
ios | Builds iOS PSPDFKit dlls. |
mac | Builds macOS PSPDFKit dlls. |
Clean | Cleans the build. |
To list all available tasks you can do ./build.sh --showdescription
.
Add the generated PSPDFKit dlls as a reference to into your own Xamarin project and add the corresponding using statements depending on the dlls referenced into your project.
using PSPDFKit.Model;
using PSPDFKit.UI;
using PSPDFKit.Instant;
Also you do need to set your license key early on in your AppDelegate
, before accessing any other PSPDFKit classes.
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
PSPDFKitGlobal.SetLicenseKey ("YOUR_LICENSE_KEY_GOES_HERE");
// ...
}
Support for Instant was added with the Xamarin.iOS Bindings for PSPDFKit 7.2.0 for iOS.
With PSPDFKit Instant, it’s easier than ever to add real-time collaboration features to your PSPDFKit-powered app, allowing your users to seamlessly share, edit, and annotate PDF documents across iOS, Android, and web. With just a few lines of code, PSPDFKit Instant gives your users a massive productivity boost.
For more information about Instant, please have a look at our website.
You can find several sample projects in the Examples
folder, including a catalog, Xamarin.Forms, and macOS example.
- Complete Step 2.
- Open the
PSPDFKit.sln
solution in Visual Studio. - Select the example project and device you want to run it on (alternatively you can also right-click on the project and select "Build
Project Name
").
This example is included in the PSPDFCatalog example, but you can also find the code here.
The PSPDFKit Instant example shows how easy and efficient Instant works. Just go the Instant demo page and tap on Instant on iOS
, this will show a code at step three, which you have to enter in the example on your device. Afterwards you'll be connected to the server and you can start testing!
The PSPDFCatalog
project includes various examples for pretty much every use-case and will help you to build your own app with PSPDFKit.
The XFSample.iOS
project is an example showcasing how to build an app with PSPDFKit using Xamarin.Forms.
MacPDFViewer
is an easy example on how build a PDF viewer on Mac.
You can find instructions on how to add stylus support here.
Please ensure you signed our CLA so we can accept your contributions.