PSPDFKit for iOS

The Best Way to Handle PDF Documents on iOS

A high-performance viewer, extensive annotation and document editing tools, digital signatures, and more. All engineered for the best possible user and developer experience. PSPDFKit — the iOS PDF SDK made for you.

iOS

Free 60-Day Trial

Download PSPDFKit for iOS and try it in your app today.

iOS

Apple PDFKit Compatible

Transition to PSPDFKit with Ease

Already using Apple PDFKit? We offer a drop-in replacement that uses PSPDFKit for iOS under the hood, enabling you to transition with ease.

Announcement

Documentation

Showcase

Apps Powered by PSPDFKit

We’re extremely proud of all the amazing apps that have been built with the help of PSPDFKit. Our main goal has always been providing developers with the highest-quality tools so they can focus on making the best apps possible.

Dropbox

Dropbox

Evernote

Evernote

Box

Box

Hipchat

Hipchat

Gumroad

Gumroad

Scribd

Scribd

“PSPDFKit handles all the heavy lifting involved in viewing and annotating PDF files. Thank you for such a wonderful product!”


“We really appreciate how responsive the PSPDFKit team is. It's a great solution that's easy to use and includes timely and helpful customer support.”

Mallory Paine
Mallory Paine
Head of iOS
Box

“PSPDFKit is clearly the best choice for PDF on iOS. It’s a solid framework, which I don’t hesitate to recommend.”

Integration

Using PSPDFKit

PSPDFKit can be integrated with just a few lines of code,
and it comes with a rich API, which allows for complete customization.

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
import PSPDFKit
import PSPDFKitUI

// Create the PSPDFDocument.
// This is the container for your PDF file. It can also manage multiple files.
let documentURL = Bundle.main.url(forResource: "Document", withExtension: "pdf")!
let document = PSPDFDocument(url: documentURL)

// Create the PDF view controller. This will present and manage the PSPDFKit UI.
let pdfController = PSPDFViewController(document: document)

// Present the PDF view controller within a UINavigationController to enable the toolbar.
present(UINavigationController(rootViewController: pdfController), animated: true)
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@import PSPDFKit;
@import PSPDFKitUI;

// Create the PSPDFDocument.
// This is the container for your PDF file. It can also manage multiple files.
NSURL *documentURL = [NSBundle.mainBundle URLForResource:@"Document" withExtension:@"pdf"];
PSPDFDocument *document = [[PSPDFDocument alloc] initWithURL:documentURL];

// Create the PDF view controller. This will present and manage the PSPDFKit UI.
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document];

// Present the PDF view controller within a UINavigationController to enable the toolbar.
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pdfController];
[self presentViewController:navController animated:YES completion:nil];
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import PSPDFKit
import PSPDFKitUI

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

// Use the configuration to set main PSPDFKit options.
let configuration = PSPDFConfiguration { (builder) in
    // Switch to continuous vertical scrolling.
    builder.pageTransition = .scrollContinuous
    builder.scrollDirection = .vertical
    // Disable the thumbnail bar.
    builder.thumbnailBarMode = .none
    // etc.
}

// Create the PDF view controller, passing the configuration object.
let pdfController = PSPDFViewController(document: document, configuration: configuration)

present(UINavigationController(rootViewController: pdfController), animated: true)
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@import PSPDFKit;
@import PSPDFKitUI;

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

// Use the configuration to set main PSPDFKit options.
PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    // Switch to continuous vertical scrolling.
    builder.pageTransition = PSPDFPageTransitionScrollContinuous;
    builder.scrollDirection = PSPDFScrollDirectionVertical;
    // Disable the thumbnail bar.
    builder.thumbnailBarMode = PSPDFThumbnailBarModeNone;
    // etc.
}];

// Create the PDF view controller, passing the configuration object.
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document configuration:configuration];

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pdfController];
[self presentViewController:navController animated:YES completion:nil];
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import PSPDFKit

let documentURL = // PDF URL from a writable location...
let document = PSPDFDocument(url: documentURL)

// Load a graphic resource from another PDF document.
let logoURL = Bundle.main.url(forResource: "Logo", withExtension: "pdf")!

// Create a custom stamp annotation on the first page.
let stampAnnotation = PSPDFStampAnnotation()
stampAnnotation.appearanceStreamGenerator = PSPDFFileAppearanceStreamGenerator(fileURL: logoURL)
stampAnnotation.boundingBox = CGRect(x: 180.0, y: 150.0, width: 444.0, height: 500.0)
document.add([stampAnnotation])

// This is a blocking save.
document.save()
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@import PSPDFKit;

NSURL *documentURL = // PDF URL from a writable location...
PSPDFDocument *document = [[PSPDFDocument alloc] initWithURL:documentURL];

// Load a graphic resource from another PDF document.
NSURL *logoURL = [NSBundle.mainBundle URLForResource:@"Logo" withExtension:@"pdf"];

// Create a custom stamp annotation on the first page.
PSPDFStampAnnotation *stampAnnotation = [[PSPDFStampAnnotation alloc] init];
stampAnnotation.appearanceStreamGenerator = [[PSPDFFileAppearanceStreamGenerator alloc] initWithFileURL:logoURL];
stampAnnotation.boundingBox = CGRectMake(180.f, 150.f, 444.f, 500.f);
[document addAnnotations:@[stampAnnotation] options:nil];

// This is a blocking save.
[document save];

Check out our guides and API docs for more examples.

Get In Touch

If you think PSPDFKit for iOS could be for you, our team will help find the best solution for your project.