Get started integrating Apryse iOS SDK

Welcome to Apryse. This guide will help you integrate a free trial of the Apryse iOS SDK into your Xcode projects for iOS applications. You can either integrate Apryse frameworks automatically using Swift Package Manager, CocoaPods, or install them manually by downloading the SDK. Pick whichever your option you prefer, but integrating with Swift Package Manager is the recommended approach. Your free trial includes unlimited trial usage and support from solution engineers.

Manually integrating iOS PDF library

Prerequisites

  1. Apryse iOS SDK

Download the SDK

Download

sh

1Take note of the location of your `PDFNet.dmg` download.

No trial license key required.

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Keep your license keys confidential.

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).

Setup

  1. Create a new Xcode Project. Call it pdfhello. For the purposes of this guide, select a view scene application.
  2. From your PDFNet.dmg download, copy the /Lib/ folder into pdfhello/.

Integrating Apryse SDK for your iOS application

  1. Select the project in the left pane and go to the General tab. Scroll down to find the Embedded Binaries section. Here, add Lib/Tools/Tools.framework and Lib/Framework-dynamic/PDFNet.framework from the Lib/ folder you copied into your project. You can do this by dragging them in from Finder or by clicking the + sign to browse your files.
Apryse Docs Image
  1. Go to the Build Phases tab and click on the + button to add a New Run Script Phase. Copy and paste the following into the shell command:This will ensure invalid slices are striped from the framework before being submitted to the app store (a longstanding Xcode bug).

Bash

1bash "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/PDFNet.framework/strip-framework.sh"
Apryse Docs Image

Add Required Permissions

Apryse uses a select number AppStore permissions to allow certain functionality such as adding image stamps and detecting the Apple Pencil. Your app's plist must include the following keys (with whatever description is appropriate for your app), or it will be rejected from the AppStore.

XML

1<key>NSCameraUsageDescription</key>
2<string>This will allow you to use the image from your camera.</string>
3<key>NSPhotoLibraryAddUsageDescription</key>
4<string>This will allow you to add images to your photo library.</string>
5<key>NSPhotoLibraryUsageDescription</key>
6<string>This will allow you to create signatures and annotations from images in your photo library.</string>
7<key>NSBluetoothAlwaysUsageDescription</key>
8<string>This will allow us to detect if an Apple Pencil is paired, enabling palm rejection and the ability to scroll with one finger while annotating.</string>
9<key>NSBluetoothPeripheralUsageDescription</key>
10<string>This will allow us detect if an Apple Pencil is paired, enabling palm rejection and the ability to scroll with one finger while annotating.</string>

Initialize Apryse

Initialize Apryse before you use any Apryse related classes or methods. This only needs to be done once.

The best practice to do this is to use the optional application:willFinishLaunchingWithOptions: method in the AppDelegate class found in either the AppDelegate.swift or AppDelegate.m file in the left pane depending on your choice of language:

1// In AppDelegate.swift
2import UIKit
3import PDFNet
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6 var window: UIWindow?
7 //... Any methods already here
8 func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 PTPDFNet.initialize("Insert Commercial License Key Here After Purchase")
10 return true
11 }
12}

While you are trialing Apryse, you can pass any string to the initialize method. A string that is not a license key will enable demo mode, where all pages are lightly watermarked.

Next step

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales