Loading repository data…
Loading repository data…
ComPDFKit / repository
ComPDF SDK for Flutter — a full-featured PDF plugin for cross-platform Android and iOS apps. Integrate PDF viewing, editing, annotations, form filling, and document management into your Flutter applications with a unified Dart API.
As part of the KDAN ecosystem, ComPDF SDK for Flutter helps developers integrate PDF viewing, annotation, editing, form, and signing capabilities into cross-platform mobile apps.
It provides a production-ready Flutter wrapper around native ComPDF SDK capabilities for both Android and iOS projects.
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 Flutter?
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
Before starting, please make sure that you have already met the following prerequisites:
ComPDF offers two types of license keys: a free 30-day trial license and a commercial license.
For the Flutter PDF SDK, the commercial license must be bound to your application’s ApplicationId and iOS BundleId.
Android
Please install the following required packages:
Operating Environment Requirements:
21 or higher.compileSdkVersion of 34 or higher.targetSdkVersion of 34 or higher.iOS
Please install the following required packages:
Operating Environment Requirements:
example with the flutter CLI:flutter create --org com.compdfkit.flutter example
cd example
example/android/app/src/main/AndroidManifest.xml , add Internet Permission and Storage Permission:<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.compdfkit.flutter.example">
+ <uses-permission android:name="android.permission.INTERNET"/>
<!-- Required to read and write documents from device storage -->
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Optional settings -->
+ <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<application
+ android:requestLegacyExternalStorage="true">
</application>
</manifest>
android/app/build.gradle:open android/app/build.gradle
android section: android {
defaultConfig {
- minSdkVersion flutter.minSdkVersion
+ minSdkVersion 21
...
}
}
android/app/src/main/java/com/example/compdfkit/flutter/example/MainActivity.java, Change the base Activity to extend FlutterFragmentActivity:- import io.flutter.embedding.android.FlutterActivity;
+ import io.flutter.embedding.android.FlutterFragmentActivity;
- public class MainActivity extends FlutterActivity {
+ public class MainActivity extends FlutterFragmentActivity {
}
Alternatively you can update the AndroidManifest.xml file to use FlutterFragmentActivity as the launcher activity:
<activity
- android:name=".MainActivity"
+ android:name="io.flutter.embedding.android.FlutterFragmentActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustPan">
Note:
FlutterFragmentActivityis not an official part of the Flutter SDK. If you need to useCPDFReaderWidgetin ComPDF for Flutter, you need to use this part of the code. You can skip this step if you don't need to use.
pubspec.yaml dependencies:
flutter:
sdk: flutter
+ compdfkit_flutter: ^2.6.9
create a pdf directory
mkdir pdfs
Copy your example document into the newly created pdfs directory and name it PDF_Document.pdf
assets directory in pubspec.yaml flutter:
+ assets:
+ - pdfs/
flutter pub get
example with the flutter CLI:flutter create --org com.compdfkit.flutter example
cd example
pubspec.yaml dependencies:
flutter:
sdk: flutter
+ compdfkit_flutter: ^2.6.9
open ios/Podfile
Note: If SSL network requests fail to download the ComPDFKit library when you run pod install, you can see the processing method in Troubleshooting).
- platform :ios, '9.0'
+ platform :ios, '12.0'
...
target 'Runner' do
use_frameworks!
use_modular_headers!`
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+ pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.6.9'
+ pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.6.9'
end
example/ios folder and run the pod install command:pod install
create a pdf directory
mkdir pdfs
Copy your example document into the newly created pdfs directory and name it PDF_Document.pdf
assets directory in pubspec.yaml flutter:
+ assets:
+ - pdfs/
<key>NSCameraUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your consent is required before you c