Try the Demo
You can try PSPDFKit in a few simple steps and get the library up and running in your app with little to no effort.
Integrate the PSPDFKit Framework
The simplest way to integrate PSPDFKit is to use Swift Package Manager. We provide a URL to the public package repository that you can add in Xcode:
1 | https://github.com/PSPDFKit/PSPDFKit-SP |
To get the extensive sample app, download the disk image (DMG). This includes the binary SDK, which can be used for manual integration.
Set the License Key
1 2 3 4 | func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { PSPDFKit.SDK.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE") return true } |
1 2 3 4 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [PSPDFKitGlobal setLicenseKey:@"YOUR_LICENSE_KEY_GOES_HERE"]; return YES; } |
Display a PDF Document
1 2 3 4 5 6 7 8 9 | import PSPDFKit import PSPDFKitUI let fileURL = Bundle.main.url(forResource: "Document", withExtension: "pdf")! let document = Document(url: fileURL) let pdfController = PDFViewController(document: document) present(UINavigationController(rootViewController: pdfController), animated: true) |
1 2 3 4 5 6 7 8 9 | #import <PSPDFKit/PSPDFKit.h> NSURL *documentURL = [NSBundle.mainBundle URLForResource:@"Document" withExtension:@"pdf"]; PSPDFDocument *document = [[PSPDFDocument alloc] initWithURL:documentURL]; PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pdfController]; [self presentViewController:navController animated:YES completion:NULL]; |
ℹ️ Note: See the various example projects in the download DMG for additional details.
Feel free to contact support if you experience any issues during integration.