Getting Started

Requirements

  • PSPDFKit for iOS with Instant

    PSPDFKit and Instant are two separate dynamic frameworks available in the same download. Download the latest release from customers.pspdfkit.com or for evaluation purposes fill out the trial form.Download the latest release, or use CocoaPods (see the integration section below).

  • A PSPDFKit Server instance

    See the Example Projects guide to get an instance up and running.

  • The latest stable Xcode

    PSPDFKit and Instant usually require the latest stable version of Xcode available at the time the release was made.

Quick Start With the Example Project

Instant comes with an example iOS project in the Examples folder, which connects to either of our example server apps.

  1. Run PSPDFKit Server locally using one of our Example Projects.
  2. In a web browser, log in to the example app with the same user ID the iOS app uses in AppDelegate.swift, which by default is ‘test’.
  3. Add a document to the server using the ‘Upload PDF’ button.
  4. Select the document to view it with PSPDFKit for Web.
  5. Open Instant-iOS-Example.xcodeproj
  6. Build and run the Instant-iOS-Example scheme on the iOS Simulator. After launching the app should load the document list from the server.
  7. Tap the document in the app to download it and show it in a PSPDFInstantViewController.
  8. Add annotations in the iOS app or in the browser to see annotation syncing.

Troubleshooting

If Instant-iOS-Example does not build, make sure you are using the latest stable version of Xcode version, and expand the Frameworks group in the Project Navigator and check that PSPDFKit.framework, PSPDFKitUI.framework and Instant.framework are black rather than red, which would mean the framework is missing. If the app runs but no documents appear make sure the serverURL and user ID in AppDelegate.swift and the server is running and the server is reachable from the device.

To run on an iOS device rather than the Simulator, set the serverURL in Instant-iOS-Example/AppDelegate.swift to match the BASE_URL in the server’s docker-compose.yml.

Integrating the Instant Framework

If you’re already using CocoaPods, the the simplest way to add PSPDFKit and Instant to your project is to add the following to your Podfile, then run pod install:

Copy
1
2
3
4
5
6
use_frameworks!

target :YourTargetName do
  pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/pspdfkit/latest.podspec'
  pod 'Instant', podspec: 'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/instant/latest.podspec'
end

Otherwise follow the steps below for manual integration:

  1. Integrate PSPDFKit

  2. Drag Instant.framework into the Embedded Binaries section of your target

  3. (Optional but recommended for production) You may want to copy debug symbols for debugging and crash reporting: add Instant.framework.dSYM to your Xcode project (do not add it to any targets - just add it to the tree) and add this as an input file to the Run Script Phase that runs strip-framework.sh added when integrating PSPDFKit. The script will copy the debug symbols into the products directory and strip it from unneeded architectures.