As part of the KDAN ecosystem, ComPDF SDK for Android enables developers to quickly and seamlessly integrate advanced PDF functionalities—such as PDF generating viewing, editing, annotating, and signing—into any Android application.
The ComPDF Android PDF Library provides an easy-to-use Java API that allows direct access to a wide range of PDF features without the need for complex configurations.
If you find ComPDF SDK useful, please consider giving us a ⭐ Star on GitHub — it helps us grow and improve! Got questions or ideas? Join the conversation in our Discussions.

Why ComPDF SDK for Android?
Easy to Integrate: Integrate PDF functionalities easily with our powerful SDK and clear documentation and guides with few lines of code.
Fully Customizable UI: Design a unique interface for your products with fully customizable UI source code by a high-performing SDK.
Comprehensive PDF Features: Supports generation, viewing, annotation, page editing, content editing, conversion, OCR, redaction, signing, forms, parsing, measurement, compression, comparison, color separation, batch processing, and more.
Faster Time-to-Market: Comprehensive SDK libraries save your time and expenses and roll out your applications and projects.
High-quality Service: We provide 24/7 professional one-to-one technical support, including onsite service and remote assistance via phone and email.
Viewer: Fast and smooth PDF rendering and viewing
Annotations:
Notes - add longer comments with adjustable icon shape and color
Ink - freehand drawing with customizable color, opacity, line thickness
Text - add, move, resize text directly on page
Inspector - adjust annotation looks (line styles, borders, colors, opacity, font)
Comment on Annotations and Update Status
Import & Export & Flatten Annotations (XFDF, FDF, JSON)
Highlight, Underline, Strikeout, Squiggly
Shapes - Rectangle, Oval, Line, Arrow, Polygon, Polyline, Cloud
Stamps, Sound, Movie, File Attachment, Link, Distance, Perimeter, Area
Forms:
Process fillable and static PDF forms
Form filling, form creation, form flattening
Document Editor:
Page manipulation - insert, delete, rotate, reorder, extract, crop
Split PDF, Merge PDF
Content Editor: Edit PDF text and images directly like in Word
Security:
Encryption - set open password, permission password
Restrict printing, copying, editing
Signatures:
Electronic Signatures - draw, type, image signatures
Digital Signatures - certificate-based signature validation
Watermark:
Add Text or Image Watermarks
Delete Watermarks
Customize Watermarks
OCR:
AI OCR
Recognize Tables, Graphics, Images
Support recognition in 80+ Languages
Compare Documents: Side-by-side document comparison to highlight differences
Redaction: Permanently remove sensitive content from PDFs
Measurement: Distance, area, perimeter measurement tools
Compress: Optimize and reduce PDF file size
Convert Files:
Convert PDF to Word, Excel, PPT, HTML, CSV, images (PNG,JPEG, JPEG, JPEG2000, BMP, TIFF, TGA, GIF), RTF, TXT, JSON, XML, markdown, searchable PDF, searchable OFD.
Convert images (PNG,JPEG, JPEG, JPEG2000, BMP, TIFF, TGA, GIF) to Word, Excel, PPT, HTML, CSV, RTF, TXT, JSON, XML.
Convert Word, Excel, PPT, HTML, CSV, PNG, RTF, TXT to PDF
UI Customization:
Toolbar Customization
UI Personalization
Ready-Made UI Options
Out-of-the-box Source Code
ComPDF SDK for Android delivers a smooth, feature-rich PDF experience on mobile devices.

ComPDF SDK for Android supports Android devices running API level 19 or newer and targets the latest stable Android 4.4 or later. In addition, it requires applications to be built with Java 8 language features enabled.
minSdkVersion of 19 or higher.compileSdkVersion of 30 or higher.targetSdkVersion of 34 or higher.This section will help you quickly get started with ComPDF SDK to make an Android app in Java with step-by-step instructions. Through the following steps, you will get a simple application that can display the contents of a specified PDF file.


Open the settings.gradle file located in your project's root directory and add the mavenCentral repository:
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() + mavenCentral() } }
Open the build.gradle file in the application module directory:

Edit it and add the complete ComPDF SDK dependency:
dependencies {
implementation 'com.compdf:compdfkit:2.6.9'
implementation 'com.compdf:compdfkit-ui:2.6.9'
}
Apply for read and write permissions in AndroidManifest.xml:
Note: On your apps that target Android 6.0 or higher, make sure to check for and request read and write permissions to external storage at runtime.
If you use an online license, please add network access permissions in AndroidManifest.xml:
)
Add the following code into the app dictionary's "build.gradle" file:
... dependencies { /ComPDF SDK/ implementation(fileTree('libs')) ... } ...
Add ComPDF SDK for Android as a dependency to the project. Inside the app dictionary's "build.gradle", add "ComPDFKit.aar", "ComPDFKit-UI.aar", and the related support libraries to the dependencies. For simplicity, update the dependencies as follows:
dependencies { ... //glide implementation 'com.github.bumptech.glide:glide:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
}
Apply for read and write permissions in AndroidManifest.xml:
Note: On your apps that target Android 6.0 or higher, make sure to check for and request read and write permissions to external storage at runtime.
If you use an online license, please add network access permissions in AndroidManifest.xml:
Add this license in the AndroidManifest.xml of the main module. In version 1.13.0, we introduced a brand-new online authentication license scheme for ComPDF SDK. By default, the SDK performs online authentication. If you are using a version prior to 1.13.0, please refer to the following example to configure the SDK for offline authentication mode:
Online license
You can also initialize ComPDF SDK in code using:
CPDFSdk.init(context, "your compdfkit license", false);
Offline license
You can also initialize ComPDF SDK in code using:
CPDFSdk.init(context, "your compdfkit license");
In the proguard-rules.pro file, please add the obfuscation configuration information for compdfkit as follows:
-keep class com.compdfkit.ui.** {*;}
-keep class com.compdfkit.core.** {*;}


Android Studio will automatically generate a source file called "MainActivity.java" and a layout file called "activity_main.xml".
The source file:

The layout file:

CPDFReaderView in your "activity_main.xml" to display the contents of the PDF document:```xml
<com.compdfkit.ui.reader.CPDFReaderView
android:id="@+id/readerview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Get the `CPDFReaderView` from the layout or create a `CPDFReaderView` directly in the code in the corresponding ***MainActivity.java*** file:
```Java
// Your MainActivity.java file
package com.compdfkit.pdfviewer;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.compdfkit.ui.reader.CPDFReaderView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Get CPDFReaderView from xml.
CPDFReaderView readerView = findViewById(R.id.readerview);
// Code to create CPDFReaderView.
// CPDFDocument readerView = new CPDFReaderView(content);
}
}
```Java // Your MainActivity.java file
... //imports
public class MainActivity extends AppCompatActivity {
// Copy the PDF file from the assets folder to the cache folder.
private void copyPdfFromAssetsToCache(String fileName) {
try {
InputStream inputStream = getAssets().open(fileName);
File outputFile = new File(getCacheDir(), fileName);
FileOutputStream outputStream = new
$ claude mcp add compdfkit-pdf-sdk-android \
-- python -m otcore.mcp_server <graph>