A Complete PDF Solution You Can Rely On

PSPDFKit is the best framework for working with PDF files. Our SDK provides first-rate PDF solutions for your application with features like annotating, signing, and form filling. We power successful projects for businesses across the globe.

Try PSPDFKit in Your App Today

The data you submit is treated confidentially and will never be disclosed to third parties.
We may occasionally send you product news and important announcements.

All Platforms Supported

Build on a modern tech stack that integrates tightly with the platform you're working on. We continuously improve our products and they gain new features every month. We grow with you as your requirements change and your project evolves.

Integrating PSPDFKit for iOS

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];

Integrating PSPDFKit for Android

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Simply launch your PDF activity like any other activity.
context.startActivity(PdfActivityIntentBuilder.fromUri(context, uri)
    .activityClass(MyPdfActivity::class.java)
    .build())

// Reuse and extend our powerful PdfActivity base class.
class MyPdfActivity : PdfActivity() {
    override fun onGenerateMenuItemIds(menuItems: MutableList<Int>) = menuItems.apply {
        add(R.id.approve_document)
    }

    override fun onCreateOptionsMenu(menu: Menu) = super.onCreateOptionsMenu(menu).apply {
        menu.findItem(R.id.approve_document).apply {
            title = "Approve Document"
            setOnMenuItemClickListener placeApprovedStamp@ {
                val pageIndex = 0
                val boundingBox = RectF(0f, 40f, 150f, 0f)
                val selectAnnotationAfterAdding = false
                fragment?.addAnnotationToPage(StampAnnotation(pageIndex, boundingBox, StampType.APPROVED), selectAnnotationAfterAdding)
                return@placeApprovedStamp true
            }
        }
    }
}
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Simply launch your PDF activity like any other activity.
context.startActivity(PdfActivityIntentBuilder.fromUri(context, uri)
    .activityClass(MyPdfActivity.class)
    .build());

// Reuse and extend our powerful PdfActivity base class.
public class MyPdfActivity extends PdfActivity {
    @Override public List<Integer> onGenerateMenuItemIds(@NonNull List<Integer> menuItems) {
        menuItems.add(R.id.approve_document);
        return menuItems;
    }

    @Override public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);

        final MenuItem approveDocumentItem = menu.findItem(R.id.approve_document);
        approveDocumentItem.setTitle("Approve Document");
        approveDocumentItem.setIcon(R.drawable.ic_approve);
        approveDocumentItem.setOnMenuItemClickListener(menuItem -> {
            final int pageIndex = 0;
            final RectF boundingBox = new RectF(0f, 40f, 150f, 0f);
            final StampAnnotation approvedStamp = new StampAnnotation(pageIndex, boundingBox, StampType.APPROVED);
            getPdfFragment().addAnnotationToPage(approvedStamp, false);
            return false;
        });

        return true;
    }
}

Integrating PSPDFKit for Web

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import PSPDFKit from "pspdfkit";

// Add an approve button to the toolbar
const approveButton = {
  type: "custom",
  title: "Approve Document",
  onPress() { placeApprovedStamp(); }
};

const instance = await PSPDFKit.load({
  container: "#pspdfkit",
  pdf: "/contract.pdf",
  toolbarItems: [...PSPDFKit.defaultToolbarItems, approveButton]
});

function placeApprovedStamp() {
  instance.createAnnotation(new PSPDFKit.Annotations.StampAnnotation({
    pageIndex: 0,
    stampType: "Approved",
    boundingBox: new PSPDFKit.Geometry.Rect({width: 150, height: 40})
  }));
}

Integrating PSPDFKit for Windows

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<ui:PdfView Name="PdfView" License="{StaticResource license}"/>

private async void AddApprovedStampAsync(StorageFile pdfFile)
{
    await PdfView.OpenStorageFileAsync(file);

    var currentPage = await PdfView.Controller.GetCurrentPageIndexAsync();
    var pageSize = await PdfView.Document.GetPageSizeAsync(currentPage);

    var stamp = new Stamp
    {
        // Place it in the center of the page.
        BoundingBox = new Rect((pageSize.Width/2)-50, (pageSize.Height/2)-25, 100, 50),
        StampType = StampType.Approved,
        PageIndex = currentPage,
    };

    // Add it to the document.
    await PdfView.Document.CreateAnnotationAsync(stamp);
}

Integrating PSPDFKit for Electron

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import PSPDFKit from "pspdfkit";

// Add an approve button to the toolbar
const approveButton = {
  type: "custom",
  title: "Approve Document",
  onPress() { placeApprovedStamp(); }
};

const instance = await PSPDFKit.load({
  container: "#pspdfkit",
  pdf: "/contract.pdf",
  toolbarItems: [...PSPDFKit.defaultToolbarItems, approveButton]
});

function placeApprovedStamp() {
  instance.createAnnotation(new PSPDFKit.Annotations.StampAnnotation({
    pageIndex: 0,
    stampType: "Approved",
    boundingBox: new PSPDFKit.Geometry.Rect({width: 150, height: 40})
  }));
}

Integrating PSPDFKit for Docker

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Start PostgreSQL Database and PSPDFKit Server
$ docker-compose up

# Upload `document.pdf` and assign it "APPROVAL_REQUEST” id
$ curl -X POST http://localhost:5000/api/documents/ \
   -H "Authorization: Token token=<secret token>" \
   -F "file=@document.pdf" \
   -F "document_id=APPROVAL_REQUEST"

# Add an "Approved" stamp
$ curl -X POST http://localhost:5000/api/documents/APPROVAL_REQUEST/annotations \
   -H "Authorization: Token token=<secret token>" \
   -d '{"content":{"stampType": "Approved", "pageIndex": 1, "bbox": [146, 383, 24, 24], ...}, "type": "pspdfkit/stamp"}'

# Fetch the flattened PDF file (saving it to document-flattened.pdf)
$ curl -o document-flattened.pdf http://localhost:5000/api/documents/APPROVAL_REQUEST/pdf?flatten=true \
   -H "Authorization: Token token=<secret token>"

Integrating PSPDFKit for Xamarin

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var document = new PSPDFDocument (NSUrl.FromFilename ("Pdf/PSPDFKit QuickStart Guide.pdf"));
var pdfViewer = new PSPDFViewController (document);
// Create a custom button for the toolbar
var addStampButton = new UIBarButtonItem("Add Stamp", UIBarButtonItemStyle.Plain, null);

addStampButton.Clicked += (sender, args) => {
    var annotationsList = new List<PSPDFAnnotation>();

   // Stamp annotation sample
   var approvedStamp = new PSPDFStampAnnotation
   {
       StampType = PSPDFStampType.Approved,
       BoundingBox = new CGRect(150, 120, 100, 50),
       // Adds the annotation to the currently viewed page
       PageIndex = pdfViewer.PageIndex
   };
   annotationsList.Add(approvedStamp);

   PSPDFAnnotation[] annotationsArray;
   annotationsArray = annotationsList.ToArray();
   pdfViewer.Document.AddAnnotations(annotationsArray, options: null);
};

pdfViewer.NavigationItem.RightBarButtonItems = new UIBarButtonItem[] { addStampButton };
NavigationController.PushViewController (pdfViewer, true);

Integrating PSPDFKit for Cordova

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Show PDF
PSPDFKitPlugin.present("Document.pdf", {
  scrollDirection: "horizontal",
  backgroundColor: "white"
});
// Add a button to the nav bar that searches the document for a specific string
var searchButton = {
  title: "Search",
  action: function() {
    PSPDFKitPlugin.search("Report", true, true);
  }
};
PSPDFKitPlugin.setRightBarButtonItems([
  searchButton,
  "annotation",
  "thumbnails"
]);

Integrating PSPDFKit for React Native

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
return (
  <View style={{ flex: 1 }}>
    <PSPDFKitView
      ref="pdfView"
      document="Document.pdf"
      style={{ flex: 1 }}
    />
    <View style={{ height: 60 }}>
      <Button
        onPress={() => {
          // Add an "Approved" stamp in the corner of the first page
          const stampAnnotation = {
            type: "pspdfkit/stamp",
            stampType: "Approved",
            bbox: [100, 100, 200, 200],
            pageIndex: 0
          };
          this.refs.pdfView.addAnnotation(stampAnnotation);
        }}
        title="Approve Document"
      />
    </View>
  </View>
)

Developers First

Our meticulously designed APIs make it easy to meet your project’s requirements. A wide array of configuration options means you can customize our SDKs to provide the functionality you need. Add our product to your app’s dependencies and be up and running right away.

Download Trial
  • Example code for fast integration
  • Easy to extend and fully customizable
  • Modern technology stack
  • World-class documentation
  • Always improving
Download Trial

Best User Interface

Best User Interface

We designed PSPDFKit with a modern interface that looks and works great out of the box. Our UI is highly configurable and comes with sensible defaults and full theming support to ensure you deliver a seamless experience to your end users.

See For Yourself

Technical Support

If you ever need assistance, you get direct access to the engineers who built the product. Whether you have questions getting started or you want to know how to best integrate new SDK features into your app, we’re here to help you find a solution.

  • Direct line to the engineers
  • Fast response time
  • Comprehensive example projects
  • Flexible licensing options

Ready to get started?

Download our trial or get in touch.

App Demo

Try our mobile SDK with our free apps.

iOS Android macOS

Web Demo

Try our Web SDK in your browser.

View Demo