Demo for macOS Library
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(opens in a new tab) 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
:
use_frameworks!
target :YourTargetName do pod 'PSPDFKit', podspec: 'https://my.pspdfkit.com/pspdfkit-macos/latest.podspec' platform :osx, '10.14'end
If you prefer, you can download the framework directly(opens in a new tab) instead and then follow the manual integration guide.
Set the License Key
func applicationWillFinishLaunching(_ notification: Notification) { PSPDFKitGlobal.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE")}
- (void)applicationWillFinishLaunching:(NSNotification *)notification { [PSPDFKitGlobal setLicenseKey:@"YOUR_LICENSE_KEY_GOES_HERE"];}
Load a PDF Document
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)")
#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 download DMG(opens in a new tab) for additional details.