Examples

Add Annotations to Images

Load an image file from a local folder to use with the PDF annotation tools. Get additional resources by visiting [Android Image annotation library](…

Add Annotations to PDF with Alpha Values

Programmatically create multiple annotation types to your PDF document. Some examples of programmatic annotations can include adding links, highlight…

Create a Digital Signature

Register and use a digital certificate for signing a PDF document. The certificate password is: test. Get additional resources by visiting our guide …

Embed Files in a PDF

Programmatically embed a file in a PDF document with file annotations. Get additional resources by visiting our guide on [programmatically creating P…

Add PDF Form Elements with JavaScript Actions Attached

Programmatically add PDF form elements with JavaScript actions attached to a page. Get additional resources by visiting our guide on [validating PDF …

Add Signature to PDF

Showcases how to digitally sign a PDF after clicking on the signature form field. Get additional resources by visiting our guide on [adding a digital…

Add Video and Gallery Annotations Programmatically

This example shows how to add a gallery and a video annotation to a document. Get additional resources by visiting our guide on [adding multimedia an…

Adding Actions to the Document Sharing Menu

Add a custom action to the document sharing menu. Get additional resources by visiting our guide on [configuring PDF sharing options in Android](/gui…

Add Watermarks to PDFs

Add custom content, like images, text, and logos, as watermarks to your document pages. Get additional resources by visiting our guide on [adding wat…

Toggle UI Visibility

This example shows how to change user interface view mode in custom Activity. Get additional resources by visiting our guide on [showing or hiding th…

Zoom and Pan Documents

See how you can programmatically zoom and pan around a PDF page, either to show a specific area or to focus on a single point on the page. Get additi…

Change How Annotation Selection is Visualized

Change how an annotation selection state is visualized. Get additional resources by visiting our [AnnotationSelectionController API documenation](/ap…

View Set Up For Continuous Scrolling

Configure the Interface for continuou vertical scrolling, with a fit-to-width page zoom mode. Get additional resources by visiting our guide on [conf…

Fragment

Create an activity using the PdfFragment. Get additional resources by visiting our guide on [building an activity around the PdfFragment](/guides/and…

Custom New Page Template

Shows how to add custom templates to the new page dialog. Get additional resources by visiting our guide on [customizing the PDF editing toolbar in A…

JavaScript Actions

Create and execute JavaScript actions within a PDF document. Get additional resources by visiting our guide on [PDF annotation actions in Android](/g…

Create PDF Annotations Programmatically

Programmatically create multiple annotation types to your PDF document. Some examples of programmatic annotations can include adding links, highlight…

Create PDF Forms Programmatically

Add new PDF Form elements in code. Get additional resources by visiting our guide on [creating fillable PDF forms in Android](/guides/android/forms/f…

Create a Custom Annotation in PDF Toolbar

Add your own items to the annotation creation toolbar. Get additional resources by visiting our guide on [customizing annotation toolbar in Android v…

Custom Search UI

Build a custom search view on top of the search API. Get additional resources by visiting our guide on [searching for text in PDFs on Android](/guide…

Add Custom Sharing Actions

How to implement custom sharing actions. Get additional resources by visiting our guide on [configure PDF sharing options in Android](/guides/android…

Custom Activity with Toolbars

Hide the default toolbars and only use contextual toolbars within a custom activity that is using PdfFragment.

Custom Annotation Inspector

Implement a custom annotation inspector or add custom views to the existing one. Get additional resources by visiting our guide on [enabling the anno…

Create a Custom UI for Navigating Between PDFs

Create a side navigation drawer to list and switch between documents. Get additional resources by visiting our [DocumentCoordinator API guide](/api/a…

Add Custom Actions to the ActionBar

This example shows how to modify the default set of ActionBar icons to your app\

Change Annotation Selection Behavior

Change the annotation selection behavior by preventing Stamp annotations to be selected after they are created. Get additional resources by visiting …

Custom Document Sharing Dialog

Show a custom dialog in the document sharing flow. Get additional resources by visiting our guide on [configuring PDF sharing options in Android](/gu…

Custom Inline Search

Example of how to use the PdfSearchViewInline in a custom layout. Get additional resources by visiting our guide on [customizing PDF viewer styling i…

Progress Data Provider

Showcases how to use the ProgressDataProvider. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guides/android/…

Custom Activity Integration with the PDF Form Editing UI

An example of using the Form Editing UI with your custom activities built around PdfFragment. Get additional resources by visiting our guide on [cust…

Change the PDF Form Highlight Color

Shows how to toggle between a custom and a theme highlight color for form elements. Get additional resources by visiting our guide on [customizing PD…

Use a Custom Set of PDF Stamp Annotations

Customizes the default set of stamps in the StampPickerDialog. Get additional resources by visiting our guide on [PDF stamp annotations in Android](/…

Custom the PDF View Layout

An example of how to customize the overall layout of the PDF viewer component. Get additional resources by visiting our guide on [customizing PDF vie…

Customize Annotation Note Hints

Change the way annotation notes are hinted at for ink annotations. Get additional resources by visiting our guide on [customizing the note icon in An…

Custom PDF Annotation Toolbar Grouping

Example of how to alter the contextual toolbar menu’s items structure and how to toggle the visibility of items. Displayed on AnnotationCreationToolb…

Vertical Scroll Bar in the Document View

Using the scroll API together with the VerticalScrollBar widget for an improved document navigation experience. Get additional resources by visiting …

Customize the Download Progress Dialog

Showcases how to build a custom DownloadProgressFragment. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guid…

Disable Annotation Properties

Shows how to disable annotation note option in the annotation editing toolbar. Get additional resources by visiting our guide on [disabling annotatio…

Disable Text Selection in PDF

Use ApplicationPolicy to prevent the copying text. Get additional resources by visiting our guide on [copying and pasting annotations in Android](/gu…

Kiosk Grid: Display Multiple PDFs

Display all documents in the assets folder in a grid view. Get additional resources by visiting our guide on [opening multiple PDFs in Android viewer…

Show Two PDFs Side by Side

Usage example for two PdfFragment instances sitting side-by-side in a single activity. Get additional resources by visiting our guide on [opening mul…

Download a PDF Into Your App

How to download a PDF document from the web. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guides/android/mi…

Annotation Overlay Mode

An example showing how to draw annotations as overlay views instead of rendering them as part of the page. Get additional resources by visiting our g…

PDF Processing and Editing

Use the PdfProcessor class for document processing. Get additional resources by visiting [Android PDF editor library](/guides/android/features/docume…

Filterable Thumbnail Grid

Shows how to use PdfProcessor and DocumentCoordinator to create a page thumbnail grid that can be filtered to show either all, or only annotated or b…

Generate PDF Report

Generate a PDF out of multiple document files, add new pages, and protect the new PDF document with a password. Get additional resources by visiting …

PDF Creation from Canvas

Shows how to create a document programmatically using an Android canvas. Get additional resources by visiting our [Android PDF generation library](/g…

XFDF Data Import and Export

The XML Forms Data Format, XFDF for short, can be used to store PDF forms and annotations data independently of a PDF document. This sample shows how…

Import and Export Instant Document JSON

Shows how to import and export Instant Document JSON with PSPDFKit. Get additional resources by visiting our guide on [how Instant JSON works](/guide…

Inline Multimedia

Display existing rich media and video annotations such as videos. Get additional resources by visiting our guide on [Embedding Video Annotations into…

JavaScript PDF Form Filling

Access and fill out PDF Forms with through the JavaScript bridge. Get additional resources by visiting our guide on [PDF annotation actions in Androi…

PDF Viewer

Launch the default PDF Viewer UI and load a PDF document in a web browser with our default configuration. Get additional resources by visiting [Andro…

Merge PDF Documents

Merge multiple PDF documents using the document processor. Get additional resources by visiting our guide on [merging multiple PDF files in Android](…

Open an AES-Encrypted PDF

An example showing how to open an AES-encrypted PDF on the fly, without storing any of the decrypted information. Get additional resources by visitin…

Open Multiple PDFs in Tabs

Open multiple PDF documents in a tabbed interface. Get additional resources by visiting our guide on [opening multiple PDFs in Android viewer](/guide…

Open Remote or Local PDFs

Open documents from the file system, from app assets or via a content provider URI, and if neccessary display download progress. Get additional resou…

Using Custom DataProviders

Load a PDF document using a custom DataProvider with PdfActivity. Get additional resources by visiting our guide on [opening PDFs from a custom data …

Annotation Rendering in PDFs

Having complete control over annotation rendering mean you can render only a custom set of annotations of a document. Get additional resources by vis…

PDF Collaboration with Instant

Connect to our example PSPDFKit Instant server and download a document for collaborative PDF editing. Get additional resources by visiting [PDF colla…

Fill Out PDF Forms Programmatically

Fill out PDF forms in code. Get additional resources by visiting our guide on [filling PDF form fields programmatically in Android](/guides/android/f…

OCR

Perform optical character recognition (OCR) on the PDF document. Get additional resources by visiting our guide on [integrating OCR SDK into Android]…

Full-Text Search Indexing

Index all pdfs of the catalog app and make them searchable. Get additional resources by visiting our guide on [indexing PDF documents on Android](/gu…

Use the Dark Theme

An example with applied custom theme. Get additional resources by visiting our guide on [customizing PDF viewer styling in Android](/guides/android/c…

PDF-Based JavaScript Calculator

An example PDF that implements a simple calculator app with JavaScript inside the document. Get additional resources by visiting our guide on [PDF an…

Password Protected PDF

An example, password-protected PDF document. The password is: test123 Get additional resources by visiting our guide on [opening password-protected P…

Random Document Replacement Example

Stress test by constantly replacing the displayed document in random time intervals.

Rotate Page Temporarily

Shows how to temporarily apply a rotation to a PDF page. Get additional resources by visiting our guide on [rotating PDF pages in Android](/guides/an…

Runtime Configuration Activity

See how to change activity configuration at runtime. Get additional resources by visiting our guide on [disabling annotation editing in Android](/gui…

Runtime Configuration Fragment

Change the PdfFragment configuration at runtime. Get additional resources by visiting our [PdfActivityConfiguration.Builder API guide](/api/android/j…

Set Annotation Flags on PDF

You can set different flags, like a NOZOOM flag to ensure the annotation is always drawn with the same dimensions on screen, on annotation objects. G…

Start PdfActivity without PDF Loaded

See how to start a PdfActivity without any PDF document loaded. Get additional resources by visiting our guide on [building an activity around the Pd…

TextToSpeech Screen Reader

A small PDF screen reader that uses Android’s TextToSpeech and is highlighting the spoken words on the fly. Get additional resources by visiting our …

Title Description Languages
Add Annotations to Images Load an image file from a local folder to use with the PDF annotation tools. Get additional resources by visiting [Android Image annotation library](… Kotlin
Add Annotations to PDF with Alpha Values Programmatically create multiple annotation types to your PDF document. Some examples of programmatic annotations can include adding links, highlight… Java
Create a Digital Signature Register and use a digital certificate for signing a PDF document. The certificate password is: test. Get additional resources by visiting our guide … Kotlin
Embed Files in a PDF Programmatically embed a file in a PDF document with file annotations. Get additional resources by visiting our guide on [programmatically creating P… Kotlin
Add PDF Form Elements with JavaScript Actions Attached Programmatically add PDF form elements with JavaScript actions attached to a page. Get additional resources by visiting our guide on [validating PDF … Java
Add Signature to PDF Showcases how to digitally sign a PDF after clicking on the signature form field. Get additional resources by visiting our guide on [adding a digital… Kotlin
Add Video and Gallery Annotations Programmatically This example shows how to add a gallery and a video annotation to a document. Get additional resources by visiting our guide on [adding multimedia an… Java
Adding Actions to the Document Sharing Menu Add a custom action to the document sharing menu. Get additional resources by visiting our guide on [configuring PDF sharing options in Android](/gui… Java
Add Watermarks to PDFs Add custom content, like images, text, and logos, as watermarks to your document pages. Get additional resources by visiting our guide on [adding wat… Kotlin
Toggle UI Visibility This example shows how to change user interface view mode in custom Activity. Get additional resources by visiting our guide on [showing or hiding th… Kotlin
Zoom and Pan Documents See how you can programmatically zoom and pan around a PDF page, either to show a specific area or to focus on a single point on the page. Get additi… Kotlin
Change How Annotation Selection is Visualized Change how an annotation selection state is visualized. Get additional resources by visiting our [AnnotationSelectionController API documenation](/ap… Kotlin
View Set Up For Continuous Scrolling Configure the Interface for continuou vertical scrolling, with a fit-to-width page zoom mode. Get additional resources by visiting our guide on [conf… Kotlin
Fragment Create an activity using the PdfFragment. Get additional resources by visiting our guide on [building an activity around the PdfFragment](/guides/and… Kotlin
Custom New Page Template Shows how to add custom templates to the new page dialog. Get additional resources by visiting our guide on [customizing the PDF editing toolbar in A… Java
JavaScript Actions Create and execute JavaScript actions within a PDF document. Get additional resources by visiting our guide on [PDF annotation actions in Android](/g… Java
Create PDF Annotations Programmatically Programmatically create multiple annotation types to your PDF document. Some examples of programmatic annotations can include adding links, highlight… Kotlin
Create PDF Forms Programmatically Add new PDF Form elements in code. Get additional resources by visiting our guide on [creating fillable PDF forms in Android](/guides/android/forms/f… Kotlin
Create a Custom Annotation in PDF Toolbar Add your own items to the annotation creation toolbar. Get additional resources by visiting our guide on [customizing annotation toolbar in Android v… Java
Custom Search UI Build a custom search view on top of the search API. Get additional resources by visiting our guide on [searching for text in PDFs on Android](/guide… Java
Add Custom Sharing Actions How to implement custom sharing actions. Get additional resources by visiting our guide on [configure PDF sharing options in Android](/guides/android… Java
Custom Activity with Toolbars Hide the default toolbars and only use contextual toolbars within a custom activity that is using PdfFragment. Java
Custom Annotation Inspector Implement a custom annotation inspector or add custom views to the existing one. Get additional resources by visiting our guide on [enabling the anno… Java
Create a Custom UI for Navigating Between PDFs Create a side navigation drawer to list and switch between documents. Get additional resources by visiting our [DocumentCoordinator API guide](/api/a… Java
Add Custom Actions to the ActionBar This example shows how to modify the default set of ActionBar icons to your app\ Kotlin
Change Annotation Selection Behavior Change the annotation selection behavior by preventing Stamp annotations to be selected after they are created. Get additional resources by visiting … Java
Custom Document Sharing Dialog Show a custom dialog in the document sharing flow. Get additional resources by visiting our guide on [configuring PDF sharing options in Android](/gu… Java
Custom Inline Search Example of how to use the PdfSearchViewInline in a custom layout. Get additional resources by visiting our guide on [customizing PDF viewer styling i… Java
Progress Data Provider Showcases how to use the ProgressDataProvider. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guides/android/… Kotlin
Custom Activity Integration with the PDF Form Editing UI An example of using the Form Editing UI with your custom activities built around PdfFragment. Get additional resources by visiting our guide on [cust… Java
Change the PDF Form Highlight Color Shows how to toggle between a custom and a theme highlight color for form elements. Get additional resources by visiting our guide on [customizing PD… Java
Use a Custom Set of PDF Stamp Annotations Customizes the default set of stamps in the StampPickerDialog. Get additional resources by visiting our guide on [PDF stamp annotations in Android](/… Java
Custom the PDF View Layout An example of how to customize the overall layout of the PDF viewer component. Get additional resources by visiting our guide on [customizing PDF vie… Kotlin
Customize Annotation Note Hints Change the way annotation notes are hinted at for ink annotations. Get additional resources by visiting our guide on [customizing the note icon in An… Kotlin
Custom PDF Annotation Toolbar Grouping Example of how to alter the contextual toolbar menu’s items structure and how to toggle the visibility of items. Displayed on AnnotationCreationToolb… Java
Vertical Scroll Bar in the Document View Using the scroll API together with the VerticalScrollBar widget for an improved document navigation experience. Get additional resources by visiting … Java
Customize the Download Progress Dialog Showcases how to build a custom DownloadProgressFragment. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guid… Java
Disable Annotation Properties Shows how to disable annotation note option in the annotation editing toolbar. Get additional resources by visiting our guide on [disabling annotatio… Java
Disable Text Selection in PDF Use ApplicationPolicy to prevent the copying text. Get additional resources by visiting our guide on [copying and pasting annotations in Android](/gu… Kotlin
Kiosk Grid: Display Multiple PDFs Display all documents in the assets folder in a grid view. Get additional resources by visiting our guide on [opening multiple PDFs in Android viewer… Kotlin
Show Two PDFs Side by Side Usage example for two PdfFragment instances sitting side-by-side in a single activity. Get additional resources by visiting our guide on [opening mul… Java
Download a PDF Into Your App How to download a PDF document from the web. Get additional resources by visiting our guide on [opening PDFs from URLs in Android](/guides/android/mi… Kotlin
Annotation Overlay Mode An example showing how to draw annotations as overlay views instead of rendering them as part of the page. Get additional resources by visiting our g… Java
PDF Processing and Editing Use the PdfProcessor class for document processing. Get additional resources by visiting [Android PDF editor library](/guides/android/features/docume… Kotlin
Filterable Thumbnail Grid Shows how to use PdfProcessor and DocumentCoordinator to create a page thumbnail grid that can be filtered to show either all, or only annotated or b… Java
Generate PDF Report Generate a PDF out of multiple document files, add new pages, and protect the new PDF document with a password. Get additional resources by visiting … Kotlin
PDF Creation from Canvas Shows how to create a document programmatically using an Android canvas. Get additional resources by visiting our [Android PDF generation library](/g… Kotlin
XFDF Data Import and Export The XML Forms Data Format, XFDF for short, can be used to store PDF forms and annotations data independently of a PDF document. This sample shows how… Java
Import and Export Instant Document JSON Shows how to import and export Instant Document JSON with PSPDFKit. Get additional resources by visiting our guide on [how Instant JSON works](/guide… Kotlin
Inline Multimedia Display existing rich media and video annotations such as videos. Get additional resources by visiting our guide on [Embedding Video Annotations into… Kotlin
JavaScript PDF Form Filling Access and fill out PDF Forms with through the JavaScript bridge. Get additional resources by visiting our guide on [PDF annotation actions in Androi… Java
PDF Viewer Launch the default PDF Viewer UI and load a PDF document in a web browser with our default configuration. Get additional resources by visiting [Andro… Kotlin
Merge PDF Documents Merge multiple PDF documents using the document processor. Get additional resources by visiting our guide on [merging multiple PDF files in Android](… Kotlin
Open an AES-Encrypted PDF An example showing how to open an AES-encrypted PDF on the fly, without storing any of the decrypted information. Get additional resources by visitin… Java
Open Multiple PDFs in Tabs Open multiple PDF documents in a tabbed interface. Get additional resources by visiting our guide on [opening multiple PDFs in Android viewer](/guide… Kotlin
Open Remote or Local PDFs Open documents from the file system, from app assets or via a content provider URI, and if neccessary display download progress. Get additional resou… Kotlin
Using Custom DataProviders Load a PDF document using a custom DataProvider with PdfActivity. Get additional resources by visiting our guide on [opening PDFs from a custom data … Kotlin
Annotation Rendering in PDFs Having complete control over annotation rendering mean you can render only a custom set of annotations of a document. Get additional resources by vis… Kotlin
PDF Collaboration with Instant Connect to our example PSPDFKit Instant server and download a document for collaborative PDF editing. Get additional resources by visiting [PDF colla… Kotlin
Fill Out PDF Forms Programmatically Fill out PDF forms in code. Get additional resources by visiting our guide on [filling PDF form fields programmatically in Android](/guides/android/f… Kotlin
OCR Perform optical character recognition (OCR) on the PDF document. Get additional resources by visiting our guide on [integrating OCR SDK into Android]… Kotlin
Full-Text Search Indexing Index all pdfs of the catalog app and make them searchable. Get additional resources by visiting our guide on [indexing PDF documents on Android](/gu… Java
Use the Dark Theme An example with applied custom theme. Get additional resources by visiting our guide on [customizing PDF viewer styling in Android](/guides/android/c… Kotlin
PDF-Based JavaScript Calculator An example PDF that implements a simple calculator app with JavaScript inside the document. Get additional resources by visiting our guide on [PDF an… Kotlin
Password Protected PDF An example, password-protected PDF document. The password is: test123 Get additional resources by visiting our guide on [opening password-protected P… Kotlin
Random Document Replacement Example Stress test by constantly replacing the displayed document in random time intervals. Java
Rotate Page Temporarily Shows how to temporarily apply a rotation to a PDF page. Get additional resources by visiting our guide on [rotating PDF pages in Android](/guides/an… Kotlin
Runtime Configuration Activity See how to change activity configuration at runtime. Get additional resources by visiting our guide on [disabling annotation editing in Android](/gui… Kotlin
Runtime Configuration Fragment Change the PdfFragment configuration at runtime. Get additional resources by visiting our [PdfActivityConfiguration.Builder API guide](/api/android/j… Kotlin
Set Annotation Flags on PDF You can set different flags, like a NOZOOM flag to ensure the annotation is always drawn with the same dimensions on screen, on annotation objects. G… Java
Start PdfActivity without PDF Loaded See how to start a PdfActivity without any PDF document loaded. Get additional resources by visiting our guide on [building an activity around the Pd… Kotlin
TextToSpeech Screen Reader A small PDF screen reader that uses Android’s TextToSpeech and is highlighting the spoken words on the fly. Get additional resources by visiting our … Java