Try the PSPDFKit Demo

Note: This article is about using the PSPDFKit trial for evaluation purposes. If you don’t yet have a trial license, fill out the trial form to get one.

You can try PSPDFKit in a few simple steps and get the library up and running in your app with little to no effort. For other integration options and setting up for a production app, please read all of the articles in our Getting Started guide.

Integrate the PSPDFKit Framework

The easiest way to get started is using CocoaPods. Add the following to your Podfile, and 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/latest.podspec'
  platform :osx, '10.12'
end

If you prefer, you can directly download the framework instead and then follow the manual integration guide.

Set the License Key

1
2
3
func applicationWillFinishLaunching(_ notification: Notification) {
    PSPDFKit.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE")
}
1
2
3
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
    [PSPDFKit setLicenseKey:@"YOUR_LICENSE_KEY_GOES_HERE"];
}

Load a PDF Document

Copy
1
2
3
4
5
6
7
import PSPDFKit

let fileURL = Bundle.main.url(forResource: "Document", withExtension: "pdf")!
let document = PSPDFDocument(url: fileURL)

// Do something with the document instance:
print("Document: \(document)")
Copy
1
2
3
4
5
6
7
#import <PSPDFKit/PSPDFKit.h>

NSURL *documentURL = [NSBundle.mainBundle URLForResource:@"Document" withExtension:@"pdf"];
PSPDFDocument *document = [[PSPDFDocument alloc] initWithURL:documentURL];

// Do something with the document instance:
NSLog(@"Loaded document: %@", document);

Note: See the various example projects in the demo download dmg for further details.