PSPDFKit Products PSPDFKit Products

PSPDFKit The PDF SDK
Developers
Trust.

Thousands of companies, organizations, governments, and developers use PSPDFKit’s software to enable collaboration, signing, markup, and more in their apps.

Relied upon by industry leaders
Designed For Developers

Powerful PDF APIs at Your Fingertips

We obsess over the details of API design so that your teams don't waste months trying to integrate and maintain complex dependencies to enable document viewing and manipulation.

5’
Web
Vanilla JS
PSPDFKit for Web
JavaScript
1
2
3
4
5
6
7
8
9
10
11
import PSPDFKit from "pspdfkit";

// Obtain a PSPDFKit document instance.
const instance = await PSPDFKit.load({
	container: "#pspdfkit",
	document: "<document-file-path>",
	licenseKey: "<license-key>"
});

console.log("PSPDFKit for Web is ready!");
console.log(instance);
PSPDFKit for iOS
Swift
Objective-C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import PSPDFKit
import PSPDFKitUI
import SwiftUI

// A \`Document\` is the container for your PDF file.
let document = Document(url: documentURL)

var body: some View {
	// A \`PDFView\` will present and manage the PSPDFKit UI.
	PDFView(document: document)
		.scrollDirection(.vertical)
		.pageTransition(.scrollContinuous)
		.pageMode(.single)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- (instancetype)initWithFrame:(CGRect)frame {
	if ((self = [super initWithFrame:frame])) {
		// Set configuration to use the custom annotation toolbar when initializing the \`PSPDFViewController\`.
		// For more details, see \`PSCCustomizeAnnotationToolbarExample.m\` from PSPDFCatalog and our documentation here: https://pspdfkit.com/guides/ios/customizing-the-interface/customize-the-annotation-toolbar/
		_pdfController = [[PSPDFViewController alloc] initWithDocument:nil configuration:[PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
			[builder overrideClass:PSPDFAnnotationToolbar.class withClass:CustomButtonAnnotationToolbar.class];
		}]];

		_pdfController.delegate = self;
		_pdfController.annotationToolbarController.delegate = self;
		_closeButton = [[UIBarButtonItem alloc] initWithImage:[PSPDFKitGlobal imageNamed:@"x"] style:UIBarButtonItemStylePlain target:self action:@selector(closeButtonPressed:)];

		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationChangedNotification object:nil];
		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationsAddedNotification object:nil];
		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationsRemovedNotification object:nil];
	}

	return self;
}
PSPDFKit for Android
Kotlin
Java
1
2
3
4
5
6
7
8
// We are opening a document from application assets.
val documentUri = Uri.parse("file:///android_asset/document.pdf")

// Build the \`Intent\` for launching the \`PdfActivity\`.
val intent = PdfActivityIntentBuilder.fromUri(context, documentUri).build()

// Launch the activity.
context.startActivity(intent)
1
2
3
4
5
6
7
8
// We are opening a document from application assets.
Uri documentUri = Uri.parse("file:///android_asset/document.pdf");

// Build the Intent for launching the PdfActivity.
Intent intent = PdfActivityIntentBuilder.fromUri(context, documentUri).build();

// Launch the activity.
context.startActivity(intent);
PSPDFKit for Flutter
Dart
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:pspdfkit_flutter/src/main.dart';

const String DOCUMENT_PATH = 'PDFs/Document.pdf';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
void showDocument(BuildContext context) async {
	final bytes = await DefaultAssetBundle.of(context).load(DOCUMENT_PATH);
	final list = bytes.buffer.asUint8List();

	final tempDir = await getTemporaryDirectory();
	final tempDocumentPath = '$\{tempDir.path\}/$DOCUMENT_PATH';

	final file = await File(tempDocumentPath).create(recursive: true);
	file.writeAsBytesSync(list);

	await Pspdfkit.present(tempDocumentPath);
}

@override
Widget build(BuildContext context) {
	final themeData = Theme.of(context);
	return MaterialApp(
		home: Scaffold(
		body: Builder(
			builder: (BuildContext context) {
				return Center(
				child: Column(
					mainAxisAlignment: MainAxisAlignment.spaceEvenly,
					children: [
						ElevatedButton(
						child: Text('Tap to Open Document',
							style: themeData.textTheme.headline4?.copyWith(fontSize: 21.0)),
							onPressed: () => showDocument(context))
					]));
			},
		)),
	);
}
}
PSPDFKit for React Native
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React, {Component} from 'react';
import {Platform} from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';

const DOCUMENT =
	Platform.OS === 'ios' ? 'Document.pdf' : 'file:///android_asset/Document.pdf';
export default class PSPDFKitDemo extends Component<{}> {
	render() {
	return (
		<PSPDFKitView
		document={DOCUMENT}
		configuration={{
			thumbnailBarMode: 'scrollable',
			pageTransition: 'scrollContinuous',
			scrollDirection: 'vertical',
		}}
		ref="pdfView"
		fragmentTag="PDF1"
		style={{flex: 1}}
		/>
	);
	}
}
PSPDFKit for Cordova
JavaScript
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
30
var app = {
	// Application Constructor
	initialize: function() {
		document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
	},

	// deviceready Event Handler
	//
	// Bind any cordova events here. Common events are:
	// 'pause', 'resume', etc.
	onDeviceReady: function() {
		this.receivedEvent('deviceready');
		const DOCUMENT = (window.cordova.platformId === "ios") ? "Document.pdf" : "file:///android_asset/Document.pdf";
		PSPDFKit.present(DOCUMENT);
	},

	// Update DOM on a Received Event
	receivedEvent: function(id) {
		var parentElement = document.getElementById(id);
		var listeningElement = parentElement.querySelector('.listening');
		var receivedElement = parentElement.querySelector('.received');

		listeningElement.setAttribute('style', 'display:none;');
		receivedElement.setAttribute('style', 'display:block;');

		console.log('Received Event: ' + id);
	}
};

app.initialize();
PSPDFKit for Xamarin
C#
1
2
3
4
5
6
7
8
9
10
11
12
using PSPDFKit.Model;
using PSPDFKit.UI;
using PSPDFKit.Instant;

var configuration = PSPDFConfiguration.FromConfigurationBuilder ((builder) => {
	builder.PageMode = PSPDFPageMode.Single;
	builder.PageTransition = PSPDFPageTransition.ScrollContinuous;
	builder.ScrollDirection = PSPDFScrollDirection.Vertical;
}));

var document = new PSPDFDocument (NSUrl.FromFilename ("document.pdf"));
var pdfViewController = new PSPDFViewController (document, configuration);
PSPDFKit for Ionic
TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Component } from "@angular/core";
import { Platform } from "@ionic/angular";

@Component({
	selector: "app-root",
	templateUrl: "app.component.html",
	styleUrls: ["app.component.scss"],
})
export class AppComponent {
	constructor(private platform: Platform) {
	this.platform.ready().then(() => {
		const DOCUMENT = this.platform.is("ios")
		? "Document.pdf"
		: "file:///android_asset/Document.pdf";
		PSPDFKit.present(DOCUMENT);
	});
	}
}
PSPDFKit for .NET
C#
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
30
// Initialize PSPDFKit with your activation key.
PSPDFKit.Sdk.Initialize("YOUR_LICENSE_KEY_GOES_HERE");

// Open a document to work on.
var document = new Document(new FileDataProvider("assets/default.pdf"));

// Add a new stamp annotation.
var jsonObject = new JObject
{
	{
		"bbox",
		new JArray
		{
			0, 0, 100, 50
		}
	},
	{"pageIndex", 0},
	{"type", "pspdfkit/stamp"},
	{"stampType", "Approved"},
	{"opacity", 1},
	{"v", 1}
};
document.GetAnnotationProvider().AddAnnotationJson(jsonObject);

// Export the changes to Instant Document JSON.
document.ExportJson(new FileDataProvider("out/instantOutput.json"));

// Render the first page and save to a PNG.
var image = document.GetPage(0).RenderPage();
image.Save("out/render.png", ImageFormat.Png);
PSPDFKit for Java
Java
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
// Initialize PSPDFKit with your activation key.
PSPDFKit.initialize("YOUR_LICENSE_KEY_GOES_HERE");

// Open a document to work on.
File file = new File("assets/default.pdf");
PdfDocument document = new PdfDocument(new FileDataProvider(file));

// Add a new stamp annotation.
JSONObject jsonObject = new JSONObject();
jsonObject.put("bbox", new float[]{0, 0, 100, 50});
jsonObject.put("pageIndex", 0);
jsonObject.put("type", "pspdfkit/stamp");
jsonObject.put("stampType", "Approved");
jsonObject.put("opacity", 1);
jsonObject.put("v", 1);
document.getAnnotationProvider().addAnnotationJson(jsonObject);

// Export the changes to Instant Document JSON.
File jsonFile = new File("out/instantOutput.json");
if (jsonFile.createNewFile()) {
	document.exportDocumentJson(new FileDataProvider(jsonFile));
}

// Render the first page and save to a PNG.
BufferedImage image = document.getPage(0).renderPage();
File pngfile = new File("out/test.png");
boolean success = ImageIO.write(image, "png", pngfile);
PSPDFKit Processor
Shell
1
2
3
4
5
# You simply supply a list of document operations to apply.
curl -F file=@Example.pdf \\
	-F operations='{"operations":[{"type": "flattenAnnotations"}]}' \\
	http://localhost:5000/process \\
	--output result.pdf
PSPDFKit for Windows
C#
Visual Basic
C++
XAML
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
30
31
32
33
34
35
// This loads a PDF from \`Assets\` as soon as the \`PdfView\` is ready.
private async void PdfViewInitializationCompletedHandler(PdfView sender, Document args)
{
	try
	{
		var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/document.pdf"));
		if (file == null) return;

		await sender.OpenStorageFileAsync(file);
	}
	catch (Exception e)
	{
		var messageDialog = new MessageDialog(e.Message);
		await messageDialog.ShowAsync();
	}
}

// This loads a PDF from a file picked by the user in the UI.
private async void Button_OpenPDF_Click(object sender, RoutedEventArgs e)
{
	// Open a \`Picker\` so the user can choose a PDF.
	var picker = new FileOpenPicker
	{
		ViewMode = PickerViewMode.Thumbnail,
		SuggestedStartLocation = PickerLocationId.DocumentsLibrary
	};
	picker.FileTypeFilter.Add(".pdf");

	var file = await picker.PickSingleFileAsync();
	if (file == null) return;

	// Open and display it in the PSPDFKit \`PdfView\`.
	var documentSource = DocumentSource.CreateFromStorageFile(file);
	await PdfView.Controller.ShowDocumentAsync(documentSource);
}
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
30
Imports Windows.Storage
Imports Windows.Storage.Pickers
Imports PSPDFKit.Document
Imports PSPDFKit.Pdf
Imports PSPDFKit.UI

Public NotInheritable Class MainPage
Inherits Page

Private Async Sub PdfViewInitializationCompletedHandler(sender As PdfView, args As Document)
Dim file As StorageFile
file = Await StorageFile.GetFileFromApplicationUriAsync(New Uri("ms-appx:///Assets/document.pdf"))

If file IsNot Nothing Then
Await sender.OpenStorageFileAsync(file)
End If
End Sub

Private Async Sub Button_OpenPDF_Click(sender As Object, e As RoutedEventArgs)
Dim picker As New FileOpenPicker
picker.FileTypeFilter.Add(".pdf")

Dim file = Await picker.PickSingleFileAsync
If file IsNot Nothing Then
Dim documentSource As DocumentSource
documentSource = DocumentSource.CreateFromStorageFile(file)
Await PdfView.Controller.ShowDocumentAsync(documentSource)
End If
End Sub
End Class
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
30
31
32
33
// This loads a PDF from \`Assets\` as soon as the \`PdfView\` is ready.
void MainPage::PdfViewInitializationCompletedHandler(UI::PdfView^ sender, Pdf::Document^ args)
{
	const auto path = ref new Uri("ms-appx:///Assets/document.pdf");

	create_task(StorageFile::GetFileFromApplicationUriAsync(path))
	.then([this](StorageFile^ file)
	{
		if (file == nullptr) return;

		PdfView->OpenStorageFileAsync(file);
	});
}

// This loads a PDF from a file picked by the user in the UI.
void MainPage::Button_OpenPDF_Click(Platform::Object^ sender, RoutedEventArgs^ e)
{
	// Open a \`Picker\` so the user can choose a PDF.
	FileOpenPicker^ openPicker = ref new FileOpenPicker();
	openPicker->ViewMode = PickerViewMode::Thumbnail;
	openPicker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
	openPicker->FileTypeFilter->Append(".pdf");

	create_task(openPicker->PickSingleFileAsync())
	.then([this](StorageFile^ file)
	{
		if (file == nullptr) return;

		// Open and display it in the PSPDFKit \`PdfView\`.
		const auto documentSource = DocumentSource::CreateFromStorageFile(file);
		PdfView->Controller->ShowDocumentAsync(documentSource);
	});
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<Page
x:Class="BasicExample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BasicExample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:PSPDFKit.UI"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
	<Page.Resources>
		<x:String x:Key="license">YOUR LICENSE GOES HERE</x:String>
	</Page.Resources>

	<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="52"/>
		</Grid.RowDefinitions>
		<ui:PdfView Grid.Row="0" Name="PdfView" License="{StaticResource license}" InitializationCompletedHandler="PdfViewInitializationCompletedHandler"/>
		<Button Content="Open PDF" HorizontalAlignment="Left" Margin="10" Grid.Row="1" Name="Button_OpenPDF" Click="Button_OpenPDF_Click"/>
	</Grid>
</Page>
PSPDFKit for Mac Catalyst
Swift
Objective-C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import PSPDFKit
import PSPDFKitUI
import SwiftUI

// A \`Document\` is the container for your PDF file.
let document = Document(url: documentURL)

var body: some View {
	// A \`PDFView\` will present and manage the PSPDFKit UI.
	PDFView(document: document)
		.scrollDirection(.vertical)
		.pageTransition(.scrollContinuous)
		.pageMode(.single)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- (instancetype)initWithFrame:(CGRect)frame {
	if ((self = [super initWithFrame:frame])) {
		// Set configuration to use the custom annotation toolbar when initializing the \`PSPDFViewController\`.
		// For more details, see \`PSCCustomizeAnnotationToolbarExample.m\` from PSPDFCatalog and our documentation here: https://pspdfkit.com/guides/ios/customizing-the-interface/customize-the-annotation-toolbar/
		_pdfController = [[PSPDFViewController alloc] initWithDocument:nil configuration:[PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
			[builder overrideClass:PSPDFAnnotationToolbar.class withClass:CustomButtonAnnotationToolbar.class];
		}]];

		_pdfController.delegate = self;
		_pdfController.annotationToolbarController.delegate = self;
		_closeButton = [[UIBarButtonItem alloc] initWithImage:[PSPDFKitGlobal imageNamed:@"x"] style:UIBarButtonItemStylePlain target:self action:@selector(closeButtonPressed:)];

		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationChangedNotification object:nil];
		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationsAddedNotification object:nil];
		[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChangedNotification:) name:PSPDFAnnotationsRemovedNotification object:nil];
	}

	return self;
}
PSPDFKit for Electron
JavaScript
1
2
3
4
5
6
7
8
9
10
11
import PSPDFKit from "pspdfkit";

// Obtain a PSPDFKit document instance.
const instance = await PSPDFKit.load({
	container: "#pspdfkit",
	document: "<document-file-path>",
	licenseKey: "<license-key>"
});

console.log("PSPDFKit for Web is ready!");
console.log(instance);
PDF Generation API
Generation
1
2
3
4
5
6
7
8
9
curl -X POST https://api.pspdfkit.com/build
	-H "Authorization: Bearer your_api_key_here"
	-o result.pdf
	-F index.html=@index.html
	-F instructions='{
			"parts": [
				{ "html": "index.html" }
			]
		}'
PDF Conversion API
Conversion
1
2
3
4
5
6
7
8
9
curl -X POST https://api.pspdfkit.com/build
	-H "Authorization: Bearer your_api_key_here"
	-o converted.pdf
	-F document=@Example1.docx
	-F instructions='{
			"parts": [
				{ "file": "document" }
			]
		}'
PDF Editor API
Editor
1
2
3
4
5
6
7
8
9
10
11
curl -X POST https://api.pspdfkit.com/build
	-H "Authorization: Bearer your_api_key_here"
	-o merged.pdf
	-F part1=@Example1.pdf
	-F part2=@Example2.pdf
	-F instructions='{
			"parts": [
				{ "file": "part1" },
				{ "file": "part2" }
			]
		}'
PDF OCR API
OCR
1
2
3
4
5
6
7
8
9
10
11
12
13
curl -X POST https://api.pspdfkit.com/build
	-H "Authorization: Bearer your_api_key_here"
	-o result.pdf
	-F document=@Example.pdf
	-F instructions='{
			"parts": [
				{ "file": "document" }
			],
			"actions": [{
				"type": "ocr",
				"language": "english"
			}]
		}'
SDK Products

Integrate PDF Functionality on All Platforms

Explore what’s possible when you easily enable viewing, markup, collaboration, and other PDF functionality within minutes. No matter the platform — iOS, Android, Windows, the web, or a hybrid technology — we have you covered.

Libraries

Add PDF Functionality to Your Backend

Batch process redactions, PDF forms, and OCR scanned text, and render and edit PDF documents with our .NET and Java libraries in your application server.

Processor

The Most Powerful PDF Microservice

Discover how Processor helps your team quickly generate PDFs out of HTML — including HTML forms — and enable Office-to-PDF conversion, OCR, redaction, and merging and exporting XFDF.

PDF API

Powerful API Tools at Your Fingertips

Our hosted product makes it easy to generate, convert or modify PDF documents in your workflows with a powerful PDF API. Leave the development and server management to us.

Support for Developers

We Are Here for You.

Our company exists to help developers build phenomenal experiences. Should your team ever need assistance, we are here to help.

Direct Access to Engineers

With direct access to the engineers who built the product, you can be assured your question will be answered in a timely matter and with the help you need.

Comprehensive Examples

Whether you have questions getting started or you want to know how to best integrate new features into your app, we’re here to help you find a solution.

Knowledge Base

Guides

Explore our comprehensive documentation and guides.

Customer Stories

Learn how our customers have accelerated their growth.

Blog

Come read more about what goes on inside PSPDFKit.

Product
Demos

Web Demo

Explore our Web SDK live to imagine what’s possible.

Demo App

The easiest way to check out our SDK’s functionality.

Sales Demo

Talk to our product experts to see how PSPDFKit fits your needs.

Ready to Get Started?

Adding our 60-day trial to your app is easy as pie. Download PSPDFKit now and add a great PDF experience to your app within minutes!

Free Trial